You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by BenXS <bx...@yahoo.co.uk> on 2010/08/16 15:17:11 UTC

Is always 1 new JMS msg = 1 new (Message driven) Bean instance?

Whenever a new JMS msg is arriving in a queue/topic where a MDbean is
listening (through "onMessage()").
Is there always a new Bean instance created and used for handling this JMS
msgs?

Or can it be that an already existing Bean instance is used for handling the
next JMS msg as well?

Ben
-- 
View this message in context: http://old.nabble.com/Is-always-1-new-JMS-msg-%3D-1-new-%28Message-driven%29-Bean-instance--tp29449154p29449154.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Is always 1 new JMS msg = 1 new (Message driven) Bean instance?

Posted by mjustin <mi...@gmx.net>.

BenXS wrote:
> 
> Whenever a new JMS msg is arriving in a queue/topic where a MDbean is
> listening (through "onMessage()").
> Is there always a new Bean instance created and used for handling this JMS
> msgs?
> 
> Or can it be that an already existing Bean instance is used for handling
> the next JMS msg as well?
> 
> Ben
> 


The EJB 3.0 specification says in chapter 5.4:


> Since all instances of a message-driven bean are equivalent, a client
> message can be delivered to any
> available instance.
> 

So it can be the same instance, or an already existing one, or a new one
which just has been created for the new incoming message.


-----
Michael Justin
SCJP, SCJA
betasoft - Software for Delphi™ and for the Java™ platform
http://www.mikejustin.com - http://www.betabeans.de
-- 
View this message in context: http://old.nabble.com/Is-always-1-new-JMS-msg-%3D-1-new-%28Message-driven%29-Bean-instance--tp29449154p29449174.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.