You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by HellKnight <he...@foxmail.com> on 2014/01/23 03:56:53 UTC

I want a queue allows only one consumer , can I do that ?

I want there is only zero or one consumer connected to a queue , if a new
consumer want to connect to this queue , the previous consumer's connection
will be closed and the new consumer will connect to this queue. How can I do
that ?  Thanks for any help in advance.



--
View this message in context: http://activemq.2283324.n4.nabble.com/I-want-a-queue-allows-only-one-consumer-can-I-do-that-tp4676687.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: I want a queue allows only one consumer , can I do that ?

Posted by artnaseef <ar...@artnaseef.com>.
There is an option with ActiveMQ for exclusive consumption like this:

queue = new ActiveMQQueue("TEST.QUEUE?consumer.exclusive=true");


For more details, see here:

http://activemq.apache.org/exclusive-consumer.html


This does not force close an existing consumer on connecting a new one
though.



--
View this message in context: http://activemq.2283324.n4.nabble.com/I-want-a-queue-allows-only-one-consumer-can-I-do-that-tp4676687p4676693.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.