What is the best way to identify the origin of a (bad) AMQP message in rabbitmq?
The scenario is several clients posts messages to a server which if successful result in messages posted to a fanout exchange (for pub/sub use). The client is also a subscriber to this queue and does not have a reply queue of its own.
If the server decides a message is invalid it nacks and discards it.
There are two additional things we want:
- to publish a message which either the client or a monitoring system might be used to say "stop sending me garbage"
- to log diagnostics about bad messages
What is an appropriate strategy for this?
Which header fields are appropriate for identifying the originator of a message?
Are they any other considerations?
The appid header field can identify the sending application but it is not sufficient by itself as there could be multiple instances on one or more machines.
A bad client could perhaps use the messageid to identify messages it sent (can this be assigned or accessed by the client).
A monitoring system (e.g. prometheus+kubernetes) would need more to try and kill the bad client process for example.
I'm assuming an appropriate approach is to require clients to set certain header fields.
Secondary to that what can we do for clients that fail don't meet our requirements there?