0

I have set up my DefaultMessageListenerContainer with implementation of javax.jms.MessageListener wired to it.

I use MQQueueConnectionFactory wired to cachingconnectionFactory. Have set cacheconsumers to true at DefaultMessageListenerContainer and have set sessionCacheSize to be equivalent to number of concurrentconsumers.

I see that , when concurrentconsumers is set to 10 , ten JMS sessions are created from a single JMS Connection. Is there a way to create the JMS sessions from 10 different JMS connections?

Please advise.

Vidya_85
  • 77
  • 9

1 Answers1

0

Not when using the caching connection factory, it is a subclass of SingleConnectionFactory; use the vendor connection factory directly if you want separate connections. Why do you want/need separate connections anyway?

It is generally not necessary to use a CCF with a listener container because the sessions are long-lived, and, in any case, caching consumers can cause issues if you use variable concurrency.

See this answer for a more detailed explanation.

Community
  • 1
  • 1
Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • I use spring integration as i have explained in this http://stackoverflow.com/questions/26671299/how-is-jms-session-handled-in-a-flow-containing-inbound-adapter-outbound-adapte . Today, i measured the performance between IBM MQ jms implementation and my new implementation of spring Integration for IBM MQ. The difference looks huge and i am in need of to improve perofrmance of my application in Spring integration.Thought this might help in improving the preformance. Can you please suggest. – Vidya_85 Nov 12 '14 at 14:47