0

Is there a way (third party software or programming) to monitor the time a message arrive to an specific queue and the time it's consumed?

something like a message arrive at 17:14:22 565 and consumed at 17:14:22 598 or the message was enqueued N miliseconds

I have read about Statistics plugin but it just give max and min times of enqueued messages

AndresDLRG
  • 136
  • 7

2 Answers2

0

You can use http://activemq.apache.org/advisory-message.html

First example below to be notified when a message is delivered to the broker. Second example to be notified when the message is consumed.

AdvisorySupport.getMessageDeliveredAdvisoryTopic()
AdvisorySupport.getMessageConsumedAdvisoryTopic()

See example here below to have access to Message properties like creation time, in or out time when a messages arrived or left the broker. Here is the list of properties http://activemq.apache.org/activemq-message-properties.html

Spring JMS Producer and Consumer interaction

Community
  • 1
  • 1
Hassen Bennour
  • 3,885
  • 2
  • 12
  • 20
0

One way is to write your own plugin. (http://activemq.apache.org/developing-plugins.html)

It's quite simple, and the effect is similar as you change activemq broker code.

You can extends BrokerFilter class, and override it's methods, like postProcessDispatch(), send(). Then you can record the time, or whatever you want in your own code.

I write a simple example (https://github.com/lcy362/FoxActivemqPlugin/blob/b54d375a6a91a9ec418e779deb69a8b11f7d985a/src/main/java/com/mallow/activemq/FoxBrokerPlugin.java), hoping that's helpful.

Mobility
  • 3,117
  • 18
  • 31