3
votes

Spring Message Listener Container doc says:

http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/jms/listener/AbstractMessageListenerContainer.html#setDurableSubscriptionName%28java.lang.String%29

The durable subscription name needs to be unique within this client's JMS client id. Default is the class name of the specified message listener. Note: Only 1 concurrent consumer (which is the default of this message listener container) is allowed for each durable subscription.

I thought, we can handle concurrent messages at the same time. Am I missing something?

2

2 Answers

2
votes

Yes, the documentation is correct. At any point of time there can be only one consumer receiving messages for a durable subscription. All durable subscriptions are identified by a unique id. If one consumer is already receiving messages using an id, another attempt create a consumer with the same id for that durable subscription will fail.

1
votes

I've had this problem before and our log was full of warnings complain about client id is already in use.

Virtual Topic is an option for ActiveMQ: the idea is similar to what @brainOverflow described, it's a combination of topic and queues. The producer sends the message to a topic which is subscribed by queues and each queue receives a copy of the message.

http://activemq.apache.org/virtual-destinations.html