Sample Code to Route to Another Instance of ActiveMQ
The notification message payload is configurable in JSON and XML to enable external integration of notification delivery for JMS queue and REST API.
The sample code shows how to route to another instance of ActiveMQ.
<bean id="extJmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="${extactivemq.url}" />
<property name="userName" value="${extactivemq.username}" />
<property name="password" value="${extactivemq.password}" />
</bean>
<bean id="extPooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
<property name="maxConnections" value="8" />
<property name="connectionFactory" ref="extJmsConnectionFactory" />
</bean>
<bean id="extJmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="extPooledConnectionFactory" />
<property name="concurrentConsumers" value="10" />
</bean>
<bean id="extJms" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="configuration" ref="extJmsConfig" />
</bean>
To use the external JMS configuration:
<to uri="extJms:queue:{{externalJMS}}" />