cancel
Showing results for 
Search instead for 
Did you mean: 

Restricting polling in sender file adapter

Former Member
0 Kudos

Hi friends,

I have a requirement where I need to poll a file from an FTP server. But, if the file is being edited (some other application is writing to it) I need to avoid picking that file. Plz tell me how i can achieve this...waiting for ur replies.

Regards,

Shilpa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shilpa,

In your sender communication channel you have an option for this. Go to file sender communication chanel --> advanced mode --> Msecs to Wait for Modification check --> put a value say 300 --> so when the file is getting picked it sees the filesize say 100kb and waits for 300ms and then once again it checks the file size and if it 110kb then this will take into account and once again after 300ms it checks the file size. Now if the filesize is 110kb then it will pick up the file else will keep on waiting till the file has the same size.

Regards,

---Satish

Former Member
0 Kudos

Satish ,

I was not having idea of this feature of File Adapter .

Thank You !!

Regards,

Former Member
0 Kudos

Hi Satish,

I believe this functionality is only possible in NFS and not in FTP.

Former Member
0 Kudos

Yes you are correct shilpa. Its only if you use NFS. I am sorry i didnot see ftp in your original post.

Now the only option left for you is to write an adapter module.

Regards,

---Satish

Former Member
0 Kudos

but then we do have the option in FTP as well.. !! Do you mean to say it doesnt work????

REgards,

Ninu

Answers (2)

Answers (2)

Former Member
0 Kudos

Shilpa,

Check out this sap note :

[https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=821267|https://websmp230.sap-ag.de/sap(bD1kZSZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=821267]

File Locking / Incomplete Processing

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?

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

Hope this will help.

Thanks,

Nilesh

Former Member
0 Kudos

shilpa ,

Don't think it is possible !!

check out :

Regards,

Former Member
0 Kudos

Help Extended :

Regards,