Can you get the consumer Id of an expired message

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Can you get the consumer Id of an expired message

kinga123
I want to know which of my consumers aren't processing data fast enough and
causing messages to expire. I am listening to the advisory
ActiveMQ.Advisory.Expired.Topic. Can I get the consumer id or at least the
client Id of the intended recipient of an expired message? Thank you.



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Can you get the consumer Id of an expired message

kinga123
Still need help - any assistance or guidance would be great!



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Can you get the consumer Id of an expired message

Tim Bain
In reply to this post by kinga123
No.

In a pub-sub paradigm, neither publishers nor messages know about the
consumers who might or might not eventually consume them. That is, in fact,
exactly the point of pub-sub.

However, ActiveMQ does provide the ability to detect and respond to slow
consumers, and to publish advisory messages about slow consumers via
the advisoryForSlowConsumers attribute. You can read more details on the
wiki (http://activemq.apache.org/slow-consumer-handling.html and
http://activemq.apache.org/advisory-message.html, for example).

Unfortunately, the default definition of when a message consumer becomes
slow is when it has a full prefetch buffer plus that many more messages on
the broker waiting to be dispatched, and although that definition works
very well for certain workflows (ones with a constant message rate,
constant time to consume each message, and a prefetch buffer that has been
tuned to the message rate), there are plenty of situations for which that
algorithm fails to detect the slow consumer or takes too long to do so.
There's a second algorithm that was added in 5.9.1 but never actually
documented on the wiki (see
http://timbish.blogspot.com/2013/07/coming-in-activemq-59-new-way-to-abort.html)
that allows you to define a consumer to be slow when any message takes
longer than a certain threshold to be consumed, but this algorithm has its
own failure cases, so neither is perfect. But if either algorithm fits your
situation, they could provide a way to achieve the goal I think you're
trying for, even though not quite in the way you were asking about.

Tim

On Tue, Sep 11, 2018, 12:24 PM kinga123 <[hidden email]> wrote:

> I want to know which of my consumers aren't processing data fast enough and
> causing messages to expire. I am listening to the advisory
> ActiveMQ.Advisory.Expired.Topic. Can I get the consumer id or at least the
> client Id of the intended recipient of an expired message? Thank you.
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Can you get the consumer Id of an expired message

kinga123
Thanks Tim! Really appreciate the great response. Also, thanks for the heads
up on that article. I don't necessarily have to "abort" the slow consumer
right? I could define the threshold so that I can just a log a slow
consumer, rather than abort them? Thanks  



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
Reply | Threaded
Open this post in threaded view
|

Re: Can you get the consumer Id of an expired message

Tim Bain
I don't believe there's a way to specify that the consumer shouldn't be
aborted, but you can get that effect by setting maxSlowDuration to a large
value.

Tim

On Fri, Sep 14, 2018, 9:23 AM kinga123 <[hidden email]> wrote:

> Thanks Tim! Really appreciate the great response. Also, thanks for the
> heads
> up on that article. I don't necessarily have to "abort" the slow consumer
> right? I could define the threshold so that I can just a log a slow
> consumer, rather than abort them? Thanks
>
>
>
> --
> Sent from:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Can you get the consumer Id of an expired message

Tim Bain
Which, re-reading your message, is what I think you were asking.

Tim

On Sun, Sep 16, 2018, 1:36 PM Tim Bain <[hidden email]> wrote:

> I don't believe there's a way to specify that the consumer shouldn't be
> aborted, but you can get that effect by setting maxSlowDuration to a large
> value.
>
> Tim
>
> On Fri, Sep 14, 2018, 9:23 AM kinga123 <[hidden email]> wrote:
>
>> Thanks Tim! Really appreciate the great response. Also, thanks for the
>> heads
>> up on that article. I don't necessarily have to "abort" the slow consumer
>> right? I could define the threshold so that I can just a log a slow
>> consumer, rather than abort them? Thanks
>>
>>
>>
>> --
>> Sent from:
>> http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html
>>
>