Friday, January 01, 2010

How to set up singleton adapter in cluster for high availability

File adapter /Ftp adapter are called as singleton adapter.It is because if you have two nodes polling for a particular file in some directory then there might arise a race condition between the two nodes so we use a singleton adapter concept in which only only node is activated for polling in to the directory.To set up singleton adapter we essentially need to set up these things.


GO to SOA_HOME\bpel\system\config\collaxa-config.xml and change it from



The value 'cluster' can be anything but has to be the same on both instances.


Next the multicast address and multicast port should be same in both the nodes of the cluster.

It can be found in

SOA_HOME\bpel\system\config\jgroups-protocol.xml under following category name

mcast_port="45788"

mcast_addr="228.8.15.24"


To enable a singleton adapter you need to add the following property in bpel.xml of the bpel process

property name="clusterGroupId" adapterCluster property

Here the cluserGroupId name that i have given "adapterCluster" must be different from the cluster name that we have defined in collaxa-config.xml.It is because the bpel engine and the adapter will use different communication channel for identifying cluster.

So once you have done all these settings you are done with the setting now in a File/FTP adapters a control file is used to coordinate information between instances, such as the sequence numbering of output files. In a clustered environment, this control file must be shared between all instances.


Now we need to do the following settings

1> Create a folder in one of the system.Share it and grant all the priviledges to the Folder(read/write/execute etc)

2> Backup and edit the pc.properties file available in the:
ORACLE_HOME\bpel\system\service\config

directory on each of the nodes, and set:
oracle.tip.adapter.file.controldirpath

to the shared folder name.

i.e for one node it will be local path and other will be pointed out through the network ip.Once the changes are done

3. Restart the servers.

Please note that in the case of ESB, you will need to rename
ORACLE_HOME\integration\esb\config\pc.properties.esb to pc.properties and make the relevant changes there.


If you will not define the clusterGroupId in the bpel.xml you may encounter issues with the working of file/ftp adapter with following error in the log files

SOA_HOME\opmn\logs\opmn.log will say


org.collaxa.thirdparty.jgroups.protocols.TP setProperties
WARNING: bind_to_all_interfaces has been deprecated; use receive_on_all_interfaces instead
org.collaxa.thirdparty.jgroups.protocols.UDP createSockets
INFO: sockets will use interface 10.32.7.156
org.collaxa.thirdparty.jgroups.protocols.UDP createSockets


It is beacuse in a singleton adapter only one node is active at a time and the other node remains passive.The jgroup interanlly use the clusterGroup id and activate one node at a time to poll the record.So when it doen't find a cluster group id it doesnt try to pick a single node at a time and which leads to a race condition and hence the error.


Sometimes you might see a case that the adapter is not doing the failover that is in case active node is crashed the second node does not start polling.This happens becasue we have not defined useJgroupConfigFile or we might have defined useJgroupConfigFile=false in our bpel.xml.


So in order to avoid this scenario we add the following property in the bpel.xml

property name="useJgroupConfigFile" true property

ie now your bpel.xml these two properties should appear as below

property name="clusterGroupId"adapterClusterproperty
property name="useJgroupConfigFile" true property

The properties which i have defined should be enclosed in xml start and end tag.As this blog doesn't support xml codes i m just placing a spcae bar in place of the start and end tag of xml.

2 comments:

Anonymous said...

Thanks a lot...

Anonymous said...

Very helpful