RabbitMQ 3.1.3 and the missing timestamp header

Is it possible to configure the broker to insert a timestamp header if the message is missing? So, if the publication client does not add the timestamp header, can the broker insert it with a timestamp corresponding to the moment when the message was received by the exchange? Where should I look for this configuration? Or is this a bad idea?

+4
source share
2 answers

So, to answer your question, there is no way to configure the broker to insert a timestamp. Nothing in the AMQP specification requires a message to know when it arrives at a broker, and keep in mind that manually setting a timestamp on the broker's side will only represent when the message was received by the broker and not when it was posted.

If you lash out at this, you can write your own RabbitMQ plugin to do this, but I would not recommend doing this. Instead, I would recommend getting your manufacturers to include a timestamp in their message properties.

Resources

RabbitMQ message arrival timestamp

RabbitMQ AMQP.BasicProperties Java API

+3
source

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

This plugin will do exactly what you were looking for.

Keep in mind that there will be some minimal overhead, as it will intercept all sent messages.

+4
source

Source: https://habr.com/ru/post/1494816/


All Articles