If your system has more than one existing brokers, it will be required to configure the JMS transport with multiple brokers. In such situations, each transport receiver should have a separate name. The following example illustrates how to configure the transport with both ActiveMQ and SwiftMQ as JMS brokers in the <ESB_Home>/repository/conf/axis2/axis2.xml
file.
Configure the JMS transport with ActiveMQ by following the procedure in Configure with Active MQ. Enter the value for the transport receiver as
jmsActiveMQ
instead of jms
as shown below.<transportReceiver name="jmsActiveMQ" class="org.apache.axis2.transport.jms.JMSListener">
Similarly, enter another configuration following the procedure in Configure with SwiftMQ. Enter the value for the transport receiver as
jmsSwiftMQ
instead of jms
as shown below.<transportReceiver name="jmsSwiftMQ" class="org.apache.axis2.transport.jms.JMSListener">
The configuration should look as follows.
<!-- ActiveMQ --> <transportReceiver name="jmsActiveMQ" class="org.apache.axis2.transport.jms.JMSListener"> <parameter name="T1ActivemQTopicConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter> </parameter> <parameter name="T1DataJMSCachingConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> <parameter name="default" locked="false"> <parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter> <parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> </transportReceiver> <!-- SwiftMQ --> <transportReceiver name="jmsSwiftMQ" class="org.apache.axis2.transport.jms.JMSListener"> <parameter name="T1SwiftTopicConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">com.swiftmq.jndi.InitialContextFactoryImpl</parameter> <parameter name="java.naming.provider.url" locked="false">smqp://</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter> <parameter name="transport.jms.JMSSpecVersion" locked="false">1.0</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter> </parameter> <parameter name="T1SwiftQueueConnectionFactory" locked="false"> <parameter name="java.naming.factory.initial" locked="false">com.swiftmq.jndi.InitialContextFactoryImpl</parameter> <parameter name="java.naming.provider.url" locked="false">smqp://</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.JMSSpecVersion" locked="false">1.0</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> <parameter name="default" locked="false"> <parameter name="java.naming.factory.initial" locked="false">com.swiftmq.jndi.InitialContextFactoryImpl</parameter> <parameter name="java.naming.provider.url" locked="false">smqp://internalip:host/type=com.swiftmq.net.JSSESocketFactory</parameter> <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter> <parameter name="transport.jms.JMSSpecVersion" locked="false">1.0</parameter> <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter> </parameter> </transportReceiver>