I am using File Adapter to process a file to target system. when i deployed my composite in clustered environment, both nodes of the cluster started processing the same file, causing duplicate records in target system.
For resolving this issue we need to use HA file adapter and set the singleton property in composite.xml .
1. HA File Adapter –>
Change the connection factory to HA file adapter like below.
<adapter-config name=”MyFile” adapter=”File Adapter”
HAFileAdapter uses database behind the scene to create mutex to make sure only one node will process one file.
2. Singleton property in composite.xml –>
Singleton property force the BPEL process to pick the file from one server at a time.