-
1. Re: Any recommendation how to use JBM2 Producers Pool?
ataylor Jul 14, 2009 4:17 AM (in response to adridi)you are correct that (1) should be avoided.
regarding (2), When you are using 1 connection per producer are you creating a new session per producer. JBM2 will share connections between sessions created by the same connection factory, see http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone/docs/usermanual-2.0.0.beta3/html_single/index.html#connection-ttl.session.multiplexing.
JMs has no notion of pooling, A JMS producer should *not* be shared between application threads, each should have its own. If you want to cut down on the number of producers being used you can write your own send method and pool the producers your self, just make sure your send method is synchronized on the producer being used. -
2. Re: Any recommendation how to use JBM2 Producers Pool?
timfox Jul 14, 2009 4:57 AM (in response to adridi)If you're servlets are running in the same AS instance as the broker and it's JBoss AS then you can just use the JMS JCA adapter to pool connections.
If it's not JBoss then you can share a ConnectionFactory (or ClientSessionFactory) instance between servlets - this will provide its own pooling of underlying connections. -
3. Re: Any recommendation how to use JBM2 Producers Pool?
adridi Jul 15, 2009 11:30 AM (in response to adridi)Thanks Tim and Andy!
The JCA adapter pool works great for me.
Abdel