• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Related to JMS Queue

 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Shrinivas Mujumdar
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic