On Fri, Aug 21, 2009 at 2:51 PM, mkeenan<kee...@p2sol.com> wrote:
>
> What is the intended relationship between connections, sessions, and
> consumers?  Is it safe to have multiple sessions on a connection? What about
> multiple consumers per session?

It is common to create many sessions from a single connection (this is
what the ActiveMQ pool and the Spring CachingConnectionFactory both
do). Most JMS brokers are very good with this model. Each consumer
should create its own sessions from a given connection and sessions
should not be shared among consumers.

> When using "transacted" session acknowledge mode, the commit or rollback
> operation occurs at the session level, so it seems that would mandate a
> single consumer. Otherwise, the commit/rollback would apply to all of the
> messages received by all consumers on that session.

Correct, sessions should be exclusive to a specific consumer and
should not be shared at all.

Bruce
-- 
perl -e 'print 
unpack("u30","D0G)u8...@4vyy9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Reply via email to