cancel
Showing results for 
Search instead for 
Did you mean: 

Sender Comm channel issue

Former Member
0 Kudos

Hi to All.

I am facing a issue sender comm channel?

comm channel is picking the file before placing the file in the source dir, the file size is some times coming morethan 6MB.

Could you please help me on this?

Thanks in advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Yadav,

sapnote_0000821267 (as suggested by Kris)

3. 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 currentfile 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

Regards,

Raghu_Vamsee

stefan_grube
Active Contributor
0 Kudos

When the file is created directly in the directory, then it can happen that the file adapter picks it up before it is written fully.

To prevent this, create the file with a temporary name and change the name to the final name after writing it.

Former Member
0 Kudos

Hi Stefan,

For this can i use dummy scenario in ID?

means can i take one more sender comm channel and receiver comm channel?

Regards,

Yadav

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Go to File sender communication channel in the Integration Directory and see what directory path is given for the file to pick up and see whether set up in the adapter is not to delete file after reading it.

Former Member
0 Kudos

Hi Gopal,

The comm channel processing mode is Archive only.

When i processed the big file it is getting issue. comm channel is picking the file before complete the file in the source dir.

Former Member
0 Kudos

Hi,

It seems that you are writing the file in the source directory through some application and PI(file adapter) is reading the file before it has completed its write operation.

Just you get the info that what would the maximum time the write operation can take and depending on that you increase the poll interval Secs in Processing section of the file adaper.

You can also archive the processed file with time stamp to tally your files.

Cheers,

Abhishek Paul.

Former Member
0 Kudos

Hi Abhishek Paul,

i have increased the polling intervel upto 300 Secs, eventhough it is not working?

we don't know the maximum time the write operation, it depends on the file Size.

Regards,

Yadav

Former Member
0 Kudos

Is there a reason, we cannot use msecs to wait before Modification check ? Are you using File content conversion or FTP adapter or your SP level does not support this option?

Did you try Stefan's approach (to rename the file after it is completely processed in your OS command)

Former Member
0 Kudos

Hi Yadav,

Now the situation is :you dont know how long the write operation can take and you also cant go on appending to the receiver file coz it can come from different file.

What you can do is :

Select Adapter specific message attribute(go to advanced and chec mark ASMA) in sender adapter and get the sender file name .Now you have it in payload and make the receiver file name same as sender file name.Now poll with anytime you want it and write in append mode to the same file.Now until the sender file name is same it would write to the same output file(go on appending ) and when the sender file name changes it will create the other file same as sender one.

But in this case your sender file name should not be changed in one full write operation i.e it shoul nbot be coming through time stamp or so.

Check it .

Cheers,

Abhishek Paul.

Former Member
0 Kudos

Hi Kris,

Can you please explain me with the code in OS Command?

We are using PI 7.1 and File Transport protocol is NFS.

Regards,

Yadav

Former Member
0 Kudos

what is your service pack.. because if you are using File adapter without file content conversion, you can use the Msecs to wait parameter (available in Advance tab when you check the Advanced mode box)... I have seen some SDN threads where this option is not available in certain service pack levels.

So the You can check the SDN threads, where they are talking about availability of this option...

As far as the OS command goes, please look at the SDN threads.. see if you can rename the file in the receiver adapter which actually creates the file (assuming that it is XI/PI interface that is creating this file in the first place) .. And if it is not PI that is creating the file, then you have to write a script that runs in your server to rename the file (as Stefan / Raghu mentions)

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/xi/sapXIFileAdapterOSCommandLine+Feature