• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

JMS Queue ConnectionsGuys,

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
reply
    Bookmark Topic Watch Topic
  • New Topic