cancel
Showing results for 
Search instead for 
Did you mean: 

partial file being picked up by file adapter

Former Member
0 Kudos

hi experts,

Say the poll interval for a sender file CC is 5 secs.
and some big  text file of arnd 5MB, comes in .
So before the channel could pick the entire file, another cycle starts and the CC starts reading other file.
And the receiver receives only a part of file.

Is there any way/ some setting other than increasing the poll interval to resolve this problem.

regards,

Aditi

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Say the poll interval for a sender file CC is 5 secs.
and some big  text file of arnd 5MB, comes in .
So before the channel could pick the entire file, another cycle starts and the CC starts reading other file.
And the receiver receives only a part of file.

Is there any way/ some setting other than increasing the poll interval to resolve this problem.

Actually, there is a solution stated in SAP Note 0000821267 - FAQ File Adapter under Question 3

  

o Q: I sometimes observe that files are processed only partially,i.e., only a fragment from the file's start is converted into an XI message. Nevertheless, the file is usually archived completely. Does the File Sender Adapter honor if another process has locked a file for exclusive use?

    

o A: Unfortunately, the J2EE 1.3 technology the File Adapter is built upon does not support file locking. This limitation affects the File Adapter's operation. Depending on whether the JRE implementation for the operating system under which the adapter runs uses mandatory file locking or advisory file locking, opening a file that is currently being written to by another process will fail or not.

If opening the file fails, no problem exists and the adapter will try to open the file each poll interval until it succeeds.However, if opening the file is not prevented by the operating system, the adapter starts to process the file although it is still being modified. Since XI 3.0 SP11 / PI 7.0 there is a parameter named "Msecs to Wait Before Modification Check" in the advanced settings of the File Sender channel configuration to work around this issue. This setting causes the File Adapter to wait a certain time after reading, but before sending a file to the Adapter Engine. If the file has been modified (which is basically determined by comparing the size of the read data with the current file size of the input file) after the configured interval has elapsed, the adapter aborts the processing of the file and tries to process the file again after the retry interval has elapsed.

If this option is not available for the settings you would like to use, the following algorithm (to be implemented in your application) may be used to ensure that the File Adapter only processes completely written files:

- Create the file using an extension, which does not get

processed by the File Adapter, e.g., ".tmp"

- Write the file content

- Rename the file to its final name, so the File Adapter will

notice its existence and pick it up

Apologies for the long quote.

Hope this helps,

Mark

Answers (2)

Answers (2)

former_member184681
Active Contributor
0 Kudos

Hi Aditi,

What you require is possible with file adapter in version SAP BASIS 7.11. In the Advanced tab page of the sender communication channel, when you mark "Advanced Mode", you can set "Msecs to Wait Before Modification Check". This is the time interval that PI waits since finding a file, until checking if it did not change. Make sure to type a value in miliseconds. Find some additional details here:
http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm

Hope this helps,
Greg

Former Member
0 Kudos

Aditi,

>>So before the channel could pick the entire file, another cycle starts and the CC starts reading other file. And the receiver receives only a part of file.

Are you sure about it ?. Can you confirm it please..

Cheers
Agasthuri