This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes JMS Queue ConnectionsGuys, Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS Queue ConnectionsGuys," Watch "JMS Queue ConnectionsGuys," New topic
Author

JMS Queue ConnectionsGuys,

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9952
    
    3

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?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 808
    
    1

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.


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9952
    
    3

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!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: JMS Queue ConnectionsGuys,
 
It's not a secret anymore!