In standalone configuration file add the following admin-object to the resource-adapter configuration for ActiveMQ:
<admin-object class-name="org.apache.activemq.ActiveMQXAConnectionFactory" jndi-name="java:/AMQXAConnectionFactory" enabled="true" use-java-context="true" pool-name="AMQXAConnectionFactory">You also need to do a modification to the ra.xml of the ActiveMQ resource-adapter consisting of adding the following:
<config-property name="brokerURL">
failover:(tcp://localhost:61616)?jms.rmIdFromConnectionId=true&maxReconnectAttempts=0&jms.xaAckMode=2&jms.userName=admin&jms.password=redhat
</config-property>
</admin-object>
<adminobject>
<adminobject-interface>javax.jms.XAConnectionFactory</adminobject-interface>
<adminobject-class>org.apache.activemq.ActiveMQXAConnectionFactory</adminobject-class>
<config-property>
<config-property-name>brokerURL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
</config-property>
</adminobject>
In the messaging subsystem add the following after hornetq-server:
<jms-bridge name="activemq-hornetq">
<source>
<connection-factory name="AMQXAConnectionFactory"/>
<destination name="queue/queueA"/>
</source>
<target>
<connection-factory name="XAConnectionFactory"/>
<destination name="queue/queueB"/>
</target>
<quality-of-service>ONCE_AND_ONLY_ONCE</quality-of-service>
<failure-retry-interval>1000</failure-retry-interval>
<max-retries>-1</max-retries>
<max-batch-size>1</max-batch-size>
<max-batch-time>100</max-batch-time>
</jms-bridge>
<jms-bridge name="hornetq-activemq">
<source>
<connection-factory name="XAConnectionFactory"/>
<destination name="queue/queueB"/>
</source>
<target>
<connection-factory name="AMQXAConnectionFactory"/>
<destination name="queue/queueC"/>
</target>
<quality-of-service>ONCE_AND_ONLY_ONCE</quality-of-service>
<failure-retry-interval>1000</failure-retry-interval>
<max-retries>-1</max-retries>
<max-batch-size>1</max-batch-size><max-batch-time>100</max-batch-time>
</jms-bridge>
Now your JMS bridge is ready to operate!