Tuesday, May 1, 2012

Changing the Archive File Name in Inbound File/FTP Adapter


Requirement:

To customize the archive file name, remove the junk characters from the archived file name. The default format is as under.

SOA 10g - filename_yyyymmdd_hh24mmss
SOA 11g - filename_encryptedToken_yyyymmdd_hh24mmss (new format introduced with 11g)

The possible customization is given in the solution below.

Solution:

SOA 10g

You have a JCA property for FIle/FTP adapter, UseLongArchiveFileName, which can be used to prefix the process name to the archive filename to make the format filename_processname_timestamp.

SOA 11g (11.1.1.3/+) 

UseLongArchiveFileName is not available in 11g. Apply Patch 10155914 and it will become available.    

SOA 11g (11.1.1.5/+) 

Apply Patch 13249896.
A new property  UseDigest can be used now in addition to  UseLongArchiveFileName (11g format as filename_processname_digest_timestamp) with File/FTP adapter.
By default UseDigest is set to true which leads to the digest (encrypted token) being sandwiched in the filename and timestamp as filename_digest_timestamp.
Setting this property to false will change the format to filename_timetamp. To use this property edit the .jca file to include this property as given below.

SOA 11g (11.1.1.7/+)

UseDigest property will be available by default without the need to apply the above patch.

There is, however, no further customization possible (presently) in terms of adding instance id to the file name or specifying custom file name. Hope the same gets available in the 11.1.1.7(+) or 12C version.

12 comments:

  1. Hi Neeraj. Do you know how to decode the timestamp to an actual date time? For isntance, here is my filename: 1338945719791_customerdata.txt. I'd like to decode the timestamp.

    ReplyDelete
  2. hi neeraj,

    can i have same filename which read in the archive folder with same filename. i gone through above material, but i couldnt get any solution out of it. usedigest property is not working .jca. can u help in downloading the patch suggested 10155914 and the procedure to install

    ReplyDelete
  3. Hi Neeraj,

    I have a requirement of Renaming the extension of the file. Suppose there is one file "a.sent" present in a folder. Then as per our requirement it should be changed to "a.ok".
    And once the extension is changed previous file should not be there, it should get deleted from there.

    Can you suggest which property of file adapter can be used to rename and move file?


    Regards,
    Shweta

    ReplyDelete
    Replies
    1. Hi Shweta,

      Sorry for the late reply. Actually for your req, you can use MOVE operation of the file adapter as given under.

      http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#CHDGFAAB

      Regards,
      Neeraj Sehgal

      Delete
  4. Hi Neeraj
    Is there a way to change the ArchiveLocation at runtime.
    There is a JCA property PhysicalArchiveDirectory, but I don't see any Bpelx inputProperty to specify the ArchiveLocation at runtime. Can you please share the same if you are aware of any..
    Thanks

    ReplyDelete
    Replies
    1. This is possible only with the same process Neeraj described about moving files in the comments above .I have posted the Oracle doc link below for your reference.

      http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm#CHDGFAAB

      Delete
  5. Hi Neeraj,

    We have developed the code in 11.1.1.4.0 and deployed. In that archive file name we are getting added encryptedpasswords and with time stamp also. Now we import the code into 11.1.1.7.0 . How we can remove that added stuff. could you please help on this.

    Thanks
    hari

    ReplyDelete
  6. Hi Neeraj,
    UseDigest jca property is working as you described here.
    but i am not able to use this property in syncRead operation.
    Is there any other way for sync read operation.
    Thanks in advance.

    ReplyDelete
    Replies
    1. Hi Neeraj, Please help me if you have information about syncGet or syncRead operations.

      Delete
  7. hi neeraj,

    i have a requirement.. i need to read a file from ftp server using ftp adapter and store the content along with the file name into the database.. how can i get the filename through osb.

    Thanks.

    ReplyDelete
  8. Is there any way to rename the archive file from filename_timetamp to only filename or filename_YYYYMMDDHH24MiSS or any custom format in 12C version?

    ReplyDelete