You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by vkcse <va...@yahoo.com> on 2014/01/28 08:08:07 UTC

Inactive/Expired CONSUMER

Hi,

I am using ActiveMQ 5.8 and to consume the queue data via code I created one
consumer and I stop/restart the consumer app and activemq when
required(without cleaning the kahaDB directory). Recently what happen is
some messages are stucked in queue itself instead of consuming when I gone
through the jconsole to see what happen I came to know that we have 2
consumers instead of one, if queue dispatch messages to one of the consumer
it is processing fine if the queue dispatch message to another it is not
processing those. Is there any chance of consumer expire/inactive? and Is
there any way to avoid this situation or to process only to active consumer? 

Thanks,
Krishna.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Inactive-Expired-CONSUMER-tp4676865.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Inactive/Expired CONSUMER

Posted by Gary Tully <ga...@gmail.com>.
all that is true, however there is way to abort a slow consumer that
has been idle or not acked a message in some time. tim did a nice
write up.
see: http://java.dzone.com/articles/coming-activemq-59-new-way

that strategy could be extended to blacklist the consumer ip.
Some test at: https://github.com/apache/activemq/blob/20f384ce59b758a0f3c1b0e0620e2efd58ca230a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/AbortSlowConsumerTest.java
and:
https://github.com/apache/activemq/blob/20f384ce59b758a0f3c1b0e0620e2efd58ca230a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/policy/AbortSlowAckConsumerTest.java

On 28 January 2014 19:51, artnaseef <ar...@artnaseef.com> wrote:
> If there is an errant/inactive consumer on a destination, the best practice
> is to locate and remove/correct that consumer.  Any actions taken to
> work-around its impact will be imperfect.  For example, considering a
> timeout, what time period would be good to use?  Too short and there's a
> risk of impacting a perfectly functioning consumer.  Too long and the errant
> consumer causes some message processing to be delayed for a long time.
> Also, automatically termining the errant consumer doesn't prevent the
> consumer from be recreated, so it could only buy a very short reprieve.
>
> There are ways to track down the errant consumer.  Can you locate that
> consumer and resolve it?
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Inactive-Expired-CONSUMER-tp4676865p4676914.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com

Re: Inactive/Expired CONSUMER

Posted by artnaseef <ar...@artnaseef.com>.
If there is an errant/inactive consumer on a destination, the best practice
is to locate and remove/correct that consumer.  Any actions taken to
work-around its impact will be imperfect.  For example, considering a
timeout, what time period would be good to use?  Too short and there's a
risk of impacting a perfectly functioning consumer.  Too long and the errant
consumer causes some message processing to be delayed for a long time. 
Also, automatically termining the errant consumer doesn't prevent the
consumer from be recreated, so it could only buy a very short reprieve.

There are ways to track down the errant consumer.  Can you locate that
consumer and resolve it?




--
View this message in context: http://activemq.2283324.n4.nabble.com/Inactive-Expired-CONSUMER-tp4676865p4676914.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Inactive/Expired CONSUMER

Posted by Christian Posta <ch...@gmail.com>.
You can use security+ACL to control who has access to consume which queues:

http://activemq.apache.org/security.html

You can also use exclusive consumer to make sure one consumer is listening:

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

On Tue, Jan 28, 2014 at 12:08 AM, vkcse <va...@yahoo.com> wrote:
> Hi,
>
> I am using ActiveMQ 5.8 and to consume the queue data via code I created one
> consumer and I stop/restart the consumer app and activemq when
> required(without cleaning the kahaDB directory). Recently what happen is
> some messages are stucked in queue itself instead of consuming when I gone
> through the jconsole to see what happen I came to know that we have 2
> consumers instead of one, if queue dispatch messages to one of the consumer
> it is processing fine if the queue dispatch message to another it is not
> processing those. Is there any chance of consumer expire/inactive? and Is
> there any way to avoid this situation or to process only to active consumer?
>
> Thanks,
> Krishna.
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Inactive-Expired-CONSUMER-tp4676865.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta