activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Can you get the consumer Id of an expired message
Date Fri, 14 Sep 2018 03:08:39 GMT
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 <ay6xp123@gmail.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message