Sounds reasonable, a variant of the exclusive consumer that is limited to one consumer would do it. Please raise a JIRA issue for this enhancement.
Consider how it should be configured. Possibly it requires an additional count attribute that limits the number of consumer that can wait for the exclusive lock, it could default to -1 meaning unlimited as is the current default for the feature: new ActiveMQQueue("TEST.QUEUE?consumer.exclusive=true&consumer.exclusiveBackupCount=0 "); A consumer that exceeds the backup count will get an exception. What do you think? An additional attribute trumps changing consumer.exclusive from boolean to int to maintain backward compatibility 2009/3/24 mffrench <mffre...@axway.com> > > my use case is one consumer per queue, that's why I would like to close any > other consumer if the resource is locked ... I think this is a really > simple > use case, isn't it ? I must say I've some difficulties to understand > rational and J2EE use case ... > > thanks > > > Gary Tully wrote: > > > > That is by design, the doc on exclusive consumers > > <http://activemq.apache.org/exclusive-consumer.html> explains the > rational > > and the J2EE use case. > > What is your use case? > > > > 2009/3/23 mffrench <mffre...@axway.com> > > > >> > >> Hello, > >> > >> There is no exception raised when I open a jms consumer on an exclusive > >> queue which is already locked by another consumer ? The second consumer > >> does > >> not receive any messages but I would like to get an exception to close > it > >> naturally... How is this possible ? > >> > >> Thanks > >> > >> > >> > >> -- > >> View this message in context: > >> > http://www.nabble.com/exception-and-exclusive-queue-tp22663885p22663885.html > >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. > >> > >> > > > > > > -- > > http://blog.garytully.com > > > > Open Source SOA > > http://FUSESource.com > > > > > > -- > View this message in context: > http://www.nabble.com/exception-and-exclusive-queue-tp22663885p22686784.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > > -- http://blog.garytully.com Open Source SOA http://FUSESource.com