You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by MarasM <co...@wp.pl> on 2006/06/01 17:08:58 UTC

Multi consumers threads question

Is it possible that ActiveMQ starts the same instance of consumer in multi
threads ? Can we set ActiveMq to create just one instance of each consumer
and not to run it in multi threads in the same time ?
--
View this message in context: http://www.nabble.com/Multi+consumers+threads+question-t1717328.html#a4663842
Sent from the ActiveMQ - Dev forum at Nabble.com.


Re: Multi consumers threads question

Posted by James Strachan <ja...@gmail.com>.
On 6/1/06, MarasM <co...@wp.pl> wrote:
>
> Is it possible that ActiveMQ starts the same instance of consumer in multi
> threads ? Can we set ActiveMq to create just one instance of each consumer
> and not to run it in multi threads in the same time ?

I don't really follow what you want I'm afraid. The JMS specification
requires that messages are processed by a single MessageConsumer by
the Session in which its created; which means that  a single
MessageConsumer has its messages processed by a single thread. If you
want to use multiple threads to process messages then using JCA such
as Jencks does that for you...

http://jencks.codehaus.org/Message+Driven+POJOs

which deals with the pooling of connections, sessions, consumers and
threads etc. Failing that use MDBs which do the same kinda thing

-- 

James
-------
http://radio.weblogs.com/0112098/