Search code examples
spring-bootrabbitmqqueueamqpspring-amqp

update payload of message in rabbitmq


Need help if possible, i try to change a message in a queue in rabbitMQ, but until now i didn't find any way to do it.

Is there any way to perform it ? like a plugin or in the RabbitMQ Http interface ?

Example : change the payload of this message :

enter image description here

For information, i use spring boot with the Amqp starter to make the connexion, is there any way to get a specific message like this message and updated ?

by Advance, thank you.


Solution

  • The request just does not make sense in Messaging at all.

    That's not a Messaging Middleware responsibility to manipulate a body of the message. In most cases it is really sensible application-based information and it even can be secured.

    On the other hand the message is immutable, so any modification to it produces a new message. And since we can't modify message on the queue there is just really no any hooks to help you.

    I think you need to reconsider your vision for the subject and put up with the fact that you can't modify message.

    But at the same time you can consume that original message, built a new one as a copy of that and with modified body and send it back to the queue. That is what you can do in the application using an appropriate consumer and producer APIs.