title: how to configure (spring) JMS connection Pool for WMQ
body: <p>I am trying to configure a JMS connection pool in spring/camel for Websphere MQ. I am seeing class cast exception, when tried to use CachingConnectionFactory from spring. Could not find a pool from WMQ, have anybody done connection pooling with WMQ, i didnt find any examples. There are lot of examples for ActiveMQ.</p>
  
  <p>here is what i have so far, that is producing class cast exception.</p>
  
  <pre><code>&lt;bean id="inCachingConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"&gt;
      &lt;property name="targetConnectionFactory" ref="inboundMqConnectionFactory1" /&gt;
      &lt;property name="sessionCacheSize" value="5" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="inboundWebsphereMq1" class="org.apache.camel.component.jms.JmsComponent"&gt;
      &lt;property name="connectionFactory" ref="inCachingConnectionFactory" /&gt;
      &lt;property name="destinationResolver" ref="jmsDestinationResolver" /&gt;
      &lt;property name="transacted" value="true" /&gt;
      &lt;property name="transactionManager" ref="txManager1" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="inboundMqConnectionFactory1" class="com.ibm.mq.jms.MQQueueConnectionFactory"&gt;
      &lt;property name="hostName" value="${isi.inbound.queue.host2}" /&gt;
      &lt;property name="port" value="${isi.inbound.queue.port}" /&gt;
      &lt;property name="queueManager" value="${isi.inbound.queue.queuemanager2}" /&gt;
      &lt;property name="channel" value="${isi.inbound.queue.channel2}" /&gt;
      &lt;property name="transportType" value="${isi.queue.transportType}" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The exception i see is here</p>
  
  <p>trying to recover. Cause: com.sun.proxy.$Proxy37 cannot be cast to com.ibm.mq.jms.MQQueueSession</p>