One of the most common use cases for Apache Camel is to link two discrete endpoints. In this post I am demonstrating how to bridge an IBM WebSphere MQ Queue to an Apache ActiveMQ Queue.

The route relies on populating properties from a file named “” configured in the Blueprint XML.

<!-- Property Placeholder -->
<cm:property-placeholder persistent-id="" update-strategy="reload" />

For the camel route to be functional, connection factories to both the IBM WebSphere MQ and Apache ActiveMQ need to be configured.

<!-- Configure Active MQ connection factory -->
<bean id="amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="${}" />
    <property name="userName" value="${amq.username}" />
    <property name="password" value="${amq.password}" />

<bean id="jmsConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="amqConnectionFactory" />
    <property name="concurrentConsumers" value="10" />

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="configuration" ref="jmsConfig" />

<!-- Configure IBM WebSphere MQ connection factory -->
<bean id="websphereConnectionFactory" class="">
    <property name="transportType" value="1" />
    <property name="hostName" value="${}" />
    <property name="port" value="${}" />
    <property name="queueManager" value="${}" />

<bean id="websphereConfig" class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="websphereConnectionFactory" />
    <property name="concurrentConsumers" value="10" />

<bean id="websphere" class="org.apache.camel.component.jms.JmsComponent">
    <property name="configuration" ref="websphereConfig" />

The actual Camel route is simple, it consumes from the “websphere” endpoint and produces to the “activemq” endpoint.

<camelContext trace="false" id="wmqToAmqContext" xmlns="">
	<route id="wmqToAmqBridge">
		<from uri="websphere:queue:{{}}?mapJmsMessage=false" />
		<log message="The message contains ${body}" />
		<to uri="activemq:queue:{{}}" />

The “” and “” properties need to be populated in the properties file.

A working route is available on my GitHub: camel-wmq-amq

Note: OSGi/Java bundles are necessary for the IBM WebSphere MQ Classes required by this Camel route. They are specific to the version of WebSphere MQ deployed. They are available inside your IBM WebSphere install directory: IBM_MQ_INSTALL_DIR/java/lib/OSGi.