You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mffrench <mf...@axway.com> on 2009/03/23 17:58:12 UTC

exception and exclusive queue

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.


Re: exception and exclusive queue

Posted by mffrench <mf...@axway.com>.
Your soluction seems to be a good one. I created the JIRA here :
https://issues.apache.org/activemq/browse/AMQ-2181

Gary Tully wrote:
> 
> 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 <mf...@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 <mf...@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
> 
> 

-- 
View this message in context: http://www.nabble.com/exception-and-exclusive-queue-tp22663885p22700518.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: exception and exclusive queue

Posted by Gary Tully <ga...@gmail.com>.
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 <mf...@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 <mf...@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

Re: exception and exclusive queue

Posted by mffrench <mf...@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 <mf...@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.


Re: exception and exclusive queue

Posted by Gary Tully <ga...@gmail.com>.
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 <mf...@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

Re: exception and exclusive queue

Posted by mffrench <mf...@axway.com>.
do I need to raise a JIRA ?

thanks ...



mffrench wrote:
> 
> 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-tp22663885p22684793.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.