Friday, 19 December 2014

Oracle B2B 12c - Listening Channel activation and deactivation in bulk

With the version 12c of B2B the possibility to activate and deactivate all listening channels in one single command was introduced. Previously, it was necessary to provide the name of the listening channels to perform the action, what, in scenarios with a considerable number of listening channels, made the task ineffective.


Different scenarios can be pointed out where this functionality is extremely useful:
  • After importing a B2B configuration the channels are always in deactivated status. This command can be then executed in order to activate all the listening channels in bulk;
  • Deactivate all listening channels to stop momentously all message consumption for corrective or preventive reasons into B2B or back-end applications;
  • Switching the message consumption between two environments;


The feature is also provided in a command line based approach since is an extension to the already existing feature of enable/disable a particular listening channel. Therefore it is respecting the same prerequisites.

Prior to executing any B2B command line tool is necessary to set the following environment variables:

JAVA_HOME: Your Java home
ORACLE_HOME: Your oracle SOA home
ANT_HOME: Your ant home

For example:

export JAVA_HOME=/usr/java/jdk1.7.0_51
export ORACLE_HOME=/u01/fmw/soa/
export ANT_HOME=/u01/fmw/oracle_common/modules/org.apache.ant_1.9.2
export PATH=$PATH:$ANT_HOME/bin

After, the first command to execute is the one which create a jndi.properties file in the folder where the SOA ant build artefact are available. The jndi.properties file allows defining the connection details to execute any of the available B2B command tools.

cd $ORACLE_HOME\bin
ant -f ant-b2b-util.xml b2bcreate-prop

A jndi.properties files is created in the folder. Now is time to edit it in order to reflect the connection details.

java.naming.provider.url=t3://localhost:8001
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.security.principal=weblogic
java.naming.security.credentials=weblogic_password

All ready to run authenticated commands as the listening channel activation and deactivation command.

From the same directory where ant-b2b-util.xml exists execute:

ant -f ant-b2b-util.xml updatechannel -Dchannelname="*" -Dstate=active
ant -f ant-b2b-util.xml updatechannel -Dchannelname="*" -Dstate=inactive

By providing the channelname as “*” all the listening channels can be activated / deactivated.

Note: The operation is performed incrementally going throughout the listening channels and activating one by one. With a large number of listening channels it can take some time between the activation and the moment that all the channels start to consume messages. Be patient and check your logs and monitor B2B in order to check the message consumption is starting.

No comments:

Post a Comment