Rabbitmq message arrival time stamp

泄露秘密 提交于 2020-01-13 08:35:47

问题


Is there a way to get the timestamp when a message was placed on the queue, from a consumer. Not when it was published, but when it actually made it to the queue.


回答1:


No there's no way to figure this out, unless, as you state yourself you write a plugin for this. There is nothing in the AMQP specification that says that the message must know when it arrived in the queue.

There is no need from the AMQP point of view to know this. There are also many cases when the message might pass through several queues and then which queue should represent the relevant timestamp?




回答2:


A duplicate question has a good answer https://stackoverflow.com/a/33640262/1689049:

As of 2015, there are new answers for the original question.

This plugin will do exactly what you were looking for.

Take in mind there will be some minimal overhead since it will hook all messages being queued.



来源:https://stackoverflow.com/questions/9216712/rabbitmq-message-arrival-time-stamp

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