• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMS Queue ConnectionsGuys,

 
Joe Harry
Ranch Hand
Posts: 10082
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have a very basic question. Let's say I have a Queue configured in a JMS server (ActiveMQ for example). I have one Producer connected to that Queue and it is sending messages to that Queue. Can I have multiple Consumers connected to that Queue. I understand that the Queue semantics is One - To - One. I'm also aware that only one Consumer would get the message. But what happens when I already have a Consumer connected to that Queue and I try to start another Consumer? Any idea as to what the JMS specifications says regarding this?
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have multiple consumers. Some time ago I tested it with Message Driven Beans (MDB) on Glassfish3 server. A couple of MDBs were listening on the Queue. When I sent the message to that queue exactly one MDB received it. The receivers were picked in a random way.
 
Joe Harry
Ranch Hand
Posts: 10082
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lucas Smith wrote:You can have multiple consumers. Some time ago I tested it with Message Driven Beans (MDB) on Glassfish3 server. A couple of MDBs were listening on the Queue. When I sent the message to that queue exactly one MDB received it. The receivers were picked in a random way.


Looks even more strange to me. I thought that the JMS server would allow only one connection as a consumer to a Queue. Every other clients trying to make a connection will get an exception. I guess I need to look into the JMS specification!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic