Timestamp when message was received by RabbitMQ

两盒软妹~` 提交于 2021-01-03 06:14:45

问题


Is there a way how to get a timestamp from time, when message was received by RabbitMQ? In our application, we would like to measure how long a message was in the queue:

time_in_queue=System.currentTimeMillis() - timestamp_from_msg

回答1:


I updated the "rabbitmq-message-timestamp" plugin. My change was merged and it is possible to use the new header "timestamp_in_ms" which contains timestamp in milliseconds.




回答2:


There's the rabbitmq_message_timestamp plugin that does that:

A plugin that adds a timestamp when a message first enters RabbitMQ.

Author: Team RabbitMQ

Github: rabbitmq/rabbitmq-message-timestamp



来源:https://stackoverflow.com/questions/45182947/timestamp-when-message-was-received-by-rabbitmq

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!