aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Related to JMS Queue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Related to JMS Queue" Watch "Related to JMS Queue" New topic
Author

Related to JMS Queue

Shrinivas Mujumdar
Ranch Hand

Joined: Aug 27, 2004
Posts: 328
Hello Friends,
I have one query related to JMS Queue, It is said that,"Multiple Queue senders & queue rceivers can be associated with a single queue, but an individual messsage can be delivered to only one queue receiver".

Well, the point of confusion is,how Message Store(or application server) routes the message to appropruate MDB as we do not send the address information related to receiver?
In short, if M1 & M2 are two MDBs attached to same queue ,can i send 2 messages to the same queue one for M1 & another to M2?

Thanx in advance
Shrinivas
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
In short, if M1 & M2 are two MDBs attached to same queue ,can i send 2 messages to the same queue one for M1 & another to M2?

That is dangerous because the EJB spec does not define what must happen if there is more than one consumer for a particular queue. The result will be unpredictable for different EJB containers and maybe different versions of the same EJB container. So, don't do it!

Of course, you can send multiple messages at about the same time to the same queue for the same MDB type. What will probably happen is that an instance will be pulled from the pool to service each request (subject constraints such as the maximum size of the pool) in a separate thread.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Shrinivas Mujumdar
Ranch Hand

Joined: Aug 27, 2004
Posts: 328
Hello Roger,
Do you want to say that a single queue is configured for single MDB? & its not possible to for two diffrent MDBs to listen to a single queue.

Thanx for quick reply
Shrinivas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Related to JMS Queue