Powered By Blogger

Tuesday, November 5, 2013

Writing same file to multiple FTP locations using FTP Dynamic Partnerlink

When we have a requirement to send the same file to multiple FTP servers, then probably we could create, multiple FTPAdapter references, one for each FTP server. However, this is not the most optimal approach; instead, you can use the concept of "Dynamic Partner Links".

In the later approach, we could create just one FTP adapter reference partner link and have multiple invoke activities invoking same reference.

First create all required FTP JCA deployment JNDIs (one for each FTP server)  in WLS admin console
For example,
eis/FTP/FTP1
eis/FTP/FTP2
eis/FTP/FTP3

In composite, create FTP adapter reference using one of above JCA connection-factory location JNDI
Connect to FTP adapter reference using invoke activity

Using dynamic partner link concept, we can change this connection-factory location dynamically using JCA header properties in both BPEL and Mediator services. To do so, BPEL or Mediator is required to use a reserved JCA header property jca.jndi as shown in the following.


If we carefully examine above code,we can understand below things
Two invoke activities are pointing to same reference 'FTPPut' and using JCA property jca.jndi which will be assigned required FTP connection-factory location JNDI.
This will invoke different FTP servers for writing same file.

Note: jca.jndi property is not available on invoke activity properties tab.We need to add manually to .bpel source file

No comments:

Post a Comment