You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by J P <jp...@gmail.com> on 2021/08/31 07:55:32 UTC

Detect ActiveMQ queue-size when JMS consumer is failing? /2

I also just realized... another issue related to this....

If a single message is failing due to some invalid contents in the msg
  ("poison pill" that will never succeed),
  since failing+retrying messages are not visible in the console,
  how can you remove it from the queue, so it doesn't
  block all subsequent messages?



On Tue, Aug 31, 2021 at 1:05 AM J P <jp...@gmail.com> wrote:

>
> We have an ActiveMQ instance, where a client is consuming from a
> jms-queue,
> reading some values from the msg and using them as parameters to an
> API-call.
>
> The order of the msgs are important, so in case of a
> failure (typically, the API called is temporarily down for a while),
> I want all msgs to REMAIN in the queue and the client
> should just try resend them until the processing succeeds,
> so I have set
>   maximumRedeliveries="-1"
>   redeliveryDelay="5000"
> for unlimited redeliveries.
>
> What I notice while testing, though, is that even though the API is down
>   (i.e. message processing is failing, and messages are getting queued up),
> the ActiveMQ console is still showing 0 messages in the queue.
>
> The "Messages Enqueued/Dequeued" are increasing,
> and I can also confirm from the logs that messages
> are actually failing and being re-sent as expected.
> Also, if I shutdown everything, and restart ActiveMQ without restarting
> the consumer, the messages re-appear in the console.
>
> But for monitoring purposes, I would just like to DETECT this situation
>   that the message backlog is growing and not getting consumed.
>
> How can I see the actual backlog/length of the
> failed-message queue (even though the console shows 0) in such a situation?
>
>
>

Re: Detect ActiveMQ queue-size when JMS consumer is failing? /2

Posted by Matt Pavlovich <ma...@gmail.com>.
Hi J P-

Your consumer code needs to handle a poison-pill message by producing the message back to a DLQ, or dropping it. With infinite redeliveries, the message will always be dispatched from the broker to that consumer.

-Matt

> On Aug 31, 2021, at 2:55 AM, J P <jp...@gmail.com> wrote:
> 
> I also just realized... another issue related to this....
> 
> If a single message is failing due to some invalid contents in the msg
>  ("poison pill" that will never succeed),
>  since failing+retrying messages are not visible in the console,
>  how can you remove it from the queue, so it doesn't
>  block all subsequent messages?
> 
> 
> 
> On Tue, Aug 31, 2021 at 1:05 AM J P <jp...@gmail.com> wrote:
> 
>> 
>> We have an ActiveMQ instance, where a client is consuming from a
>> jms-queue,
>> reading some values from the msg and using them as parameters to an
>> API-call.
>> 
>> The order of the msgs are important, so in case of a
>> failure (typically, the API called is temporarily down for a while),
>> I want all msgs to REMAIN in the queue and the client
>> should just try resend them until the processing succeeds,
>> so I have set
>>  maximumRedeliveries="-1"
>>  redeliveryDelay="5000"
>> for unlimited redeliveries.
>> 
>> What I notice while testing, though, is that even though the API is down
>>  (i.e. message processing is failing, and messages are getting queued up),
>> the ActiveMQ console is still showing 0 messages in the queue.
>> 
>> The "Messages Enqueued/Dequeued" are increasing,
>> and I can also confirm from the logs that messages
>> are actually failing and being re-sent as expected.
>> Also, if I shutdown everything, and restart ActiveMQ without restarting
>> the consumer, the messages re-appear in the console.
>> 
>> But for monitoring purposes, I would just like to DETECT this situation
>>  that the message backlog is growing and not getting consumed.
>> 
>> How can I see the actual backlog/length of the
>> failed-message queue (even though the console shows 0) in such a situation?
>> 
>> 
>>