tags:

views:

342

answers:

3

I am getting the following error:

javax.jms.ResourceAllocationException: [C4073]: A JMS destination limit was reached. Too many Subscribers/Receivers for Queue

The setup was done in such a way that there is one provider and two consumers. Is the reason this error is happening because it is a queue and it can only have one provider and one consumer?

+2  A: 

Queues in JMS are point-to-point mechanisms, you're not supposed to use them if you have multiple consumers. You should use topics for that.

Post the full code if you'd like, so we can try and help more, since it's not really clear what your code is doing.

JMS basic concepts http://java.sun.com/products/jms/tutorial/1_3_1-fcs/doc/basics.html

That being said, according to Sun, this is the info for this error:

C4073 

Message A JMS destination limit was reached. Too many Subscribers/Receivers for {0} : {1}

{0} is replaced with “Queue” or “Topic” {1} is replaced with the destination name.

Cause The client runtime was unable to create a message consumer for the specified domain and destination due to a broker resource constraint.
Uri
A: 

You actually can use queues with multiple consumers. Topics may not be what you want. A topic will work as a publish/subscribe model, where each consumer will get a copy of the message; whereas with queues, the JMS provider should only dispatch the message to one consumer.

There might be a config setting on your JMS provider that is limiting you to one consumer per queue. I've only used ActiveMQ for JMS, but it allows you to have mutliple consumers on a single queue - it basically load balances the requests between the consumers.

Andy White
A: 

Could you please explain how to support multiple subscriber to same queue. Seems only latest subscriber call back in executed.

Thank you.

A. Habib
@A. Habib: please post your question as a question and don't post it as an answer to a related question.
Joachim Sauer