Demas Sinner
Demas Sinner

Reputation: 101

MessagesKilled on DLQ

I have a DLQ with a large amount of "Messages killed". The broker is a single node. There is no cluster.

According to this documentation "Messages killed" is :

Amount of messages that have been killed on the broker to exceeding the max delivery attempts and is collected form the sum of subcomponent=queues#MessagesKilled for all queues.

What use case is ActiveMQ Artemis trying to solve? Why on earth does DLQ have any amount of Messages killed? I expect this value to be 0 initially anyway.

Attributes:

Upvotes: 0

Views: 837

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35217

The actual description of "Messages killed" can be acquired from the MBean itself which states:

number of messages removed from this queue since it was created due to exceeding the max delivery attempts

Generally speaking, the use-case being solved here is a message which cannot be consumed (for whatever reason) is being removed from the queue (i.e. killed) so that the consumer can receive, and hopefully successfully process, a different message. The behavior is 100% configurable in broker.xml.

There are a handful of important metrics here:

  • Acknowledge attempts 68890
  • Message count 1539
  • Messages acknowledged 0
  • Messages added 70429
  • Messages killed 68890

Acknowledge "attempts" and actual acknowledgements are tracked independently because, for example, a message may be acknowledged in a transaction and then that transaction can be rolled back in which case the message won't actually be acknowledged. That appears to be the case here since there have been 68,890 attempts to acknowledge but 0 actual acknowledgements. I can only assume that the max-delivery-attempts for this queue is 1 since there are also 68,890 killed messages. Notice too that the number of messages added is 70,429 which corresponds to the message count of 1,539 (i.e. 70,429 - 68,890 = 1,539). Everything seems to be accounted for.

My conclusion is that you have (or had) a consumer that is (or was) attempting to consume messages from this queue via a transaction, and that transaction was rolled back in every instance.

Keep in mind that a "dead-letter queue" is just a normal queue like any other. All the same configuration and semantics apply to it as they would apply to any other queue.

Upvotes: 2

Related Questions