The similar-minded project Reactor Kafka allows propagation of "Correlation Metadata" with sent Records: https://github.com/reactor/reactor-kafka/blob/master/src/main/java/reactor/kafka/sender/internals/DefaultKafkaSender.java#L116
It would be great to get this functionality implemented on Reactor RabbitMQ's Sender and OutboundMessage here:
https://github.com/reactor/reactor-rabbitmq/blob/master/src/main/java/reactor/rabbitmq/Sender.java#L187
Motivation
It is sometimes desired to be able to propagate information that is not strictly a subset of the information serialized on RabbitMQ messages. This information may be logical in nature, for example, a callback. There is not yet a place on OutboundMessage to propagate such information.
Reactor Kafka provides this ability as "correlation metadata" on sent SenderRecords. It should be fairly straightforward to add this functionality to OutboundMessage
Note that there is a TODO as a placeholder for this functionality:
https://github.com/reactor/reactor-rabbitmq/blob/master/src/main/java/reactor/rabbitmq/OutboundMessage.java#L36-L37
Desired solution
OutboundMessage will have generically parameterized correlationMetadata associated with each Message. The resulting send methods on Sender will be parameterized with this type information
Considered alternatives
N/A
Additional context
We have a project that propagates callbacks to originating message emitters in order to notify "message processing has been completed or failed" (in this case, with an ack or nack). We don't have this ability for usage with RabbitMQ in the absence of correlationMetadata on OutboundMessage