How do I integrate the servicemix-jms component with WebsphereMQ?

Connecting to external JMS providers is a common request. It requires a JMS connection factory from the JMS vendor. Below is an example of the configuration to be used in the xbean.xml file for the servicemix-jms binding component SU to consume messages from IBM WebsphereMQ/MQSeries:

<beans xmlns:jms="http://servicemix.apache.org/jms/1.0"
       xmlns:foo="http://mycompany.com/foo"
       xmlns:util="http://www.springframework.org/schema/util">

  <jms:endpoint service="foo:MyMQService"
    endpoint="mq"
    targetService="foo:TARGET_SERVICE_NAME_GOES_HERE"
    targetEndpoint="TARGET_ENDPOINT_GOES_HERE"
    role="consumer"
    destinationStyle="queue"
    jmsProviderDestinationName="QUEUE_NAME_GOES_HERE"
    connectionFactory="#mqConnectionFactory"
    defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />


  <bean id="mqConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
    <property name="transportType">
      <util:constant static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" />
    </property>
    <property name="queueManager" value="QMGR_NAME_GOES_HERE" />
    <property name="hostName" value="HOST_ADDRESS_GOES_HERE" />
    <property name="channel" value="QMGR_CHANNEL_NAME_GOES_HERE" />
    <property name="port" value="PORT_NUMBER_GOES_HERE" />
  </bean>

</beans>

The key to this configuration is the connection factory provided by IBM named com.ibm.mq.jms.MQQueueConnectionFactory. This class must be acquired from IBM as it is not provided with ServiceMix or ActiveMQ.