You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sloanecourt <an...@fundtech-fm.com> on 2015/11/08 17:41:41 UTC

Re: Configuring JMS connection pool for WMQ

It would appear that in MQConnectionFactory V7 onwards 

connectionFactory.setUseConnectionPooling(boolean yesno);

is deprecated, and has no affect.

See
https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.javadoc.doc/WMQJMSClasses/com/ibm/mq/jms/MQConnectionFactory.html


David J. M. Karlsen wrote
> Yes to all questions.
> Just use the internal pooling:
> com.ibm.mq.jms.MQConnectionFactory has a property
> setUseConnectionPooling(boolean yesno)
> 
> 
> 2014-04-15 19:12 GMT+02:00 smadarapu &lt;

> srikanth.madarapu@

> &gt;:
> 
>> Hi
>>
>> I have been successfully running several routes connecting to a JMS queue
>> using Websphere MQ. I have several routes each of them handling specific
>> messages (using selectors). No I am at a point where the number of
>> connections to the queue are growing and want to use a connection pool.
>>
>> I am trying the CachingConnectionFactory but running into class cast
>> exceptions...
>>
>> 
> <bean id="inCachingConnectionFactory"
>>
>  class="org.springframework.jms.connection.CachingConnectionFactory">
>>         
> <property name="targetConnectionFactory"
>>
>  ref="inboundMqConnectionFactory1"
>> />
>>         
> <property name="sessionCacheSize" value="5" />
>> 
> </bean>
>>
>> 
> <bean id="inboundWebsphereMq1"
>>
>  class="org.apache.camel.component.jms.JmsComponent">
>>         
> <property name="connectionFactory"
>>
>  ref="inCachingConnectionFactory" />
>>         
> <property name="destinationResolver" ref="jmsDestinationResolver"
>>
>  />
>>         
> <property name="transacted" value="true" />
>>         
> <property name="transactionManager" ref="txManager1" />
>> 
> </bean>
>>
>> 
> <bean id="inboundMqConnectionFactory1"
>>
>  class="com.ibm.mq.jms.MQQueueConnectionFactory">
>>         
> <property name="hostName" value="${isi.inbound.queue.host2}" />
>>         
> <property name="port" value="${isi.inbound.queue.port}" />
>>         
> <property name="queueManager"
>>
>  value="${isi.inbound.queue.queuemanager2}" />
>>         
> <property name="channel" value="${isi.inbound.queue.channel2}" />
>>         
> <property name="transportType" value="${isi.queue.transportType}"
>>
>  />
>> 
> </bean>
>>
>> Could not find a WMQ specific connection pool and according to this post
>>
>> http://stackoverflow.com/questions/8922339/how-to-pooling-the-jms-connection-in-a-standalone-java-applications
>> the pool support has been removed by WMQ, not sure why.
>>
>> Have any body have success using a connection pool with camel, spring,
>> wmq
>> ?
>>
>> Thanks
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
> 
> 
> 
> -- 
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen


David J. M. Karlsen wrote
> Yes to all questions.
> Just use the internal pooling:
> com.ibm.mq.jms.MQConnectionFactory has a property
> setUseConnectionPooling(boolean yesno)
> 
> 
> 2014-04-15 19:12 GMT+02:00 smadarapu &lt;

> srikanth.madarapu@

> &gt;:
> 
>> Hi
>>
>> I have been successfully running several routes connecting to a JMS queue
>> using Websphere MQ. I have several routes each of them handling specific
>> messages (using selectors). No I am at a point where the number of
>> connections to the queue are growing and want to use a connection pool.
>>
>> I am trying the CachingConnectionFactory but running into class cast
>> exceptions...
>>
>> 
> <bean id="inCachingConnectionFactory"
>>
>  class="org.springframework.jms.connection.CachingConnectionFactory">
>>         
> <property name="targetConnectionFactory"
>>
>  ref="inboundMqConnectionFactory1"
>> />
>>         
> <property name="sessionCacheSize" value="5" />
>> 
> </bean>
>>
>> 
> <bean id="inboundWebsphereMq1"
>>
>  class="org.apache.camel.component.jms.JmsComponent">
>>         
> <property name="connectionFactory"
>>
>  ref="inCachingConnectionFactory" />
>>         
> <property name="destinationResolver" ref="jmsDestinationResolver"
>>
>  />
>>         
> <property name="transacted" value="true" />
>>         
> <property name="transactionManager" ref="txManager1" />
>> 
> </bean>
>>
>> 
> <bean id="inboundMqConnectionFactory1"
>>
>  class="com.ibm.mq.jms.MQQueueConnectionFactory">
>>         
> <property name="hostName" value="${isi.inbound.queue.host2}" />
>>         
> <property name="port" value="${isi.inbound.queue.port}" />
>>         
> <property name="queueManager"
>>
>  value="${isi.inbound.queue.queuemanager2}" />
>>         
> <property name="channel" value="${isi.inbound.queue.channel2}" />
>>         
> <property name="transportType" value="${isi.queue.transportType}"
>>
>  />
>> 
> </bean>
>>
>> Could not find a WMQ specific connection pool and according to this post
>>
>> http://stackoverflow.com/questions/8922339/how-to-pooling-the-jms-connection-in-a-standalone-java-applications
>> the pool support has been removed by WMQ, not sure why.
>>
>> Have any body have success using a connection pool with camel, spring,
>> wmq
>> ?
>>
>> Thanks
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
> 
> 
> 
> -- 
> --
> David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen





--
View this message in context: http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258p5773513.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Configuring JMS connection pool for WMQ

Posted by Sashika <sa...@gmail.com>.
I'm doing the same with java code (not spring) and it works perfectly fine.
Only difference is I'm using a UserCredentialsConnectionFactoryAdapter
in between. Please refer the below code snippet.
https://gist.github.com/sashikaxp/3f2be0d4c3e729fc7139

Hope this helps




On Sun, Nov 8, 2015 at 10:11 PM, sloanecourt <an...@fundtech-fm.com>
wrote:

> It would appear that in MQConnectionFactory V7 onwards
>
> connectionFactory.setUseConnectionPooling(boolean yesno);
>
> is deprecated, and has no affect.
>
> See
>
> https://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.1.0/com.ibm.mq.javadoc.doc/WMQJMSClasses/com/ibm/mq/jms/MQConnectionFactory.html
>
>
> David J. M. Karlsen wrote
> > Yes to all questions.
> > Just use the internal pooling:
> > com.ibm.mq.jms.MQConnectionFactory has a property
> > setUseConnectionPooling(boolean yesno)
> >
> >
> > 2014-04-15 19:12 GMT+02:00 smadarapu &lt;
>
> > srikanth.madarapu@
>
> > &gt;:
> >
> >> Hi
> >>
> >> I have been successfully running several routes connecting to a JMS
> queue
> >> using Websphere MQ. I have several routes each of them handling specific
> >> messages (using selectors). No I am at a point where the number of
> >> connections to the queue are growing and want to use a connection pool.
> >>
> >> I am trying the CachingConnectionFactory but running into class cast
> >> exceptions...
> >>
> >>
> > <bean id="inCachingConnectionFactory"
> >>
> >  class="org.springframework.jms.connection.CachingConnectionFactory">
> >>
> > <property name="targetConnectionFactory"
> >>
> >  ref="inboundMqConnectionFactory1"
> >> />
> >>
> > <property name="sessionCacheSize" value="5" />
> >>
> > </bean>
> >>
> >>
> > <bean id="inboundWebsphereMq1"
> >>
> >  class="org.apache.camel.component.jms.JmsComponent">
> >>
> > <property name="connectionFactory"
> >>
> >  ref="inCachingConnectionFactory" />
> >>
> > <property name="destinationResolver" ref="jmsDestinationResolver"
> >>
> >  />
> >>
> > <property name="transacted" value="true" />
> >>
> > <property name="transactionManager" ref="txManager1" />
> >>
> > </bean>
> >>
> >>
> > <bean id="inboundMqConnectionFactory1"
> >>
> >  class="com.ibm.mq.jms.MQQueueConnectionFactory">
> >>
> > <property name="hostName" value="${isi.inbound.queue.host2}" />
> >>
> > <property name="port" value="${isi.inbound.queue.port}" />
> >>
> > <property name="queueManager"
> >>
> >  value="${isi.inbound.queue.queuemanager2}" />
> >>
> > <property name="channel" value="${isi.inbound.queue.channel2}" />
> >>
> > <property name="transportType" value="${isi.queue.transportType}"
> >>
> >  />
> >>
> > </bean>
> >>
> >> Could not find a WMQ specific connection pool and according to this post
> >>
> >>
> http://stackoverflow.com/questions/8922339/how-to-pooling-the-jms-connection-in-a-standalone-java-applications
> >> the pool support has been removed by WMQ, not sure why.
> >>
> >> Have any body have success using a connection pool with camel, spring,
> >> wmq
> >> ?
> >>
> >> Thanks
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
> David J. M. Karlsen wrote
> > Yes to all questions.
> > Just use the internal pooling:
> > com.ibm.mq.jms.MQConnectionFactory has a property
> > setUseConnectionPooling(boolean yesno)
> >
> >
> > 2014-04-15 19:12 GMT+02:00 smadarapu &lt;
>
> > srikanth.madarapu@
>
> > &gt;:
> >
> >> Hi
> >>
> >> I have been successfully running several routes connecting to a JMS
> queue
> >> using Websphere MQ. I have several routes each of them handling specific
> >> messages (using selectors). No I am at a point where the number of
> >> connections to the queue are growing and want to use a connection pool.
> >>
> >> I am trying the CachingConnectionFactory but running into class cast
> >> exceptions...
> >>
> >>
> > <bean id="inCachingConnectionFactory"
> >>
> >  class="org.springframework.jms.connection.CachingConnectionFactory">
> >>
> > <property name="targetConnectionFactory"
> >>
> >  ref="inboundMqConnectionFactory1"
> >> />
> >>
> > <property name="sessionCacheSize" value="5" />
> >>
> > </bean>
> >>
> >>
> > <bean id="inboundWebsphereMq1"
> >>
> >  class="org.apache.camel.component.jms.JmsComponent">
> >>
> > <property name="connectionFactory"
> >>
> >  ref="inCachingConnectionFactory" />
> >>
> > <property name="destinationResolver" ref="jmsDestinationResolver"
> >>
> >  />
> >>
> > <property name="transacted" value="true" />
> >>
> > <property name="transactionManager" ref="txManager1" />
> >>
> > </bean>
> >>
> >>
> > <bean id="inboundMqConnectionFactory1"
> >>
> >  class="com.ibm.mq.jms.MQQueueConnectionFactory">
> >>
> > <property name="hostName" value="${isi.inbound.queue.host2}" />
> >>
> > <property name="port" value="${isi.inbound.queue.port}" />
> >>
> > <property name="queueManager"
> >>
> >  value="${isi.inbound.queue.queuemanager2}" />
> >>
> > <property name="channel" value="${isi.inbound.queue.channel2}" />
> >>
> > <property name="transportType" value="${isi.queue.transportType}"
> >>
> >  />
> >>
> > </bean>
> >>
> >> Could not find a WMQ specific connection pool and according to this post
> >>
> >>
> http://stackoverflow.com/questions/8922339/how-to-pooling-the-jms-connection-in-a-standalone-java-applications
> >> the pool support has been removed by WMQ, not sure why.
> >>
> >> Have any body have success using a connection pool with camel, spring,
> >> wmq
> >> ?
> >>
> >> Thanks
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > --
> > David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Configuring-JMS-connection-pool-for-WMQ-tp5750258p5773513.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>