cancel
Showing results for 
Search instead for 
Did you mean: 

Payload Swap Bean And File Sender Adapter

Former Member
0 Kudos


Hello,

I have a question regarding the payload swap bean together with the file sender adapter. I have configured

the communication channel so that it reads a file with suffix trg and a csv file as trigger. Purpose of the

payload swap is to let the csv file become the payload.

The payload swap bean is configured as shown below.On reading the two files the audit log reports that the

respective message attachment containing the csv file was swapped but the incoming message still holds

the csv as attachment and the trigger as payload.

Do I miss anything in my configuration? (System PI 7.11)

Kind regards,

Heiko

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos

In addition - I think you can even pick the .csv file as main payload and specify the trigger file as additional file(attachment), instead of using payload swap bean?

Former Member
0 Kudos

Hareesh,

>>I think you can even pick the .csv file as main payload and specify the trigger file as additional file(attachment)

I think that's not gng to work all the time (technically at some instances this scenario will fail)

Let me give u a simple example, if "1.csv" file comes first (which i believe should be the case behind such a design) and PI couldn't able to find attachment "1.trg" then file sender channel will start throwing an error.

And secondly suppose, "1.csv" is there in the source folder and "1.trg" never comes (due to any reason) then channel won't process any other message which comes after "1.csv" until and unless someone manually delete 1.csv from the folder.

Thanks

Amit Srivastava

former_member184720
Active Contributor
0 Kudos

Amit - I completely understand that and i know those error cases.

The same applies with current configuration too. If there is a trigger file but no csv file(due to any reason)  channel still throws exception.

I just suggested an alternate solution and i assume it's up to the user to decide based on his requirement.

Thanks.

Former Member
0 Kudos

Again i would differ on this, the main intention of not using csv as the main document because channel will throw unnecessary exception if PI starts polling and no trigger file exist even if the trigger file is on its way.

Thanks

Amit Srivastava

former_member184720
Active Contributor
0 Kudos

I never denied it to differ.

Former Member
0 Kudos

Hello,

Ur config looks OK to me and it should work...

What's the receiver system? Are u doing any mapping or it's just a pass through? I would suggest you to check the final file generated on receiver system (in case of a pass through).

Thanks

Amit Srivastava

engswee
Active Contributor
0 Kudos

Heiko

As mentioned by Amit, the swap should work as expected.

However based on my own experience, although the swap is indicated in the audit log, it is not reflected in the MainDocument/Attachment names when viewed in the monitor. This does not mean that the swap did not happen. During runtime, the processing will treat the attachment as the main payload for processing. As suggested by Amit, check the final file on the receiver system to verify.

Rgds

Eng Swee

Former Member
0 Kudos

Hello,

thank you all for your responses. I'll check if the mapping receives the attachment CSV as payload event though the swap doesn't show up in SXMB_MONI. The reason while the main file is the trigger and the attachment the csv is the following: csv files log related messages that flow through our system. If all related messages of a certain transmission have been processed PI writes an end trigger file. This effects the csv to be picked up by the file sender above. Then an email is generated. However, if a transmission of related messages fails, it might be that only a csv file is written and no a trigger. If the csv is set as main file, no csv - even if a trigger file exists - is read from the directory. I was hoping to avoid this behaviour on making the trigger file the main file.

Kind regards,

Heiko