/**
* Makes this builder's properties builder use a reference to properties.
* @param properties The properties.
* @return this.
*/
public MessageBuilder andProperties(MessageProperties properties) {
MessageBuilder
message.getMessageProperties().setCorrelationId()
AbstractRabbitListenerContainerFactory
/**
* Set post processors that will be applied before sending replies.
* @param beforeSendReplyPostProcessors the post processors.
* @since 2.0.3
*/
public void setBeforeSendReplyPostProcessors(MessagePostProcessor... beforeSendReplyPostProcessors) {
org.springframework.messaging.support.MessageBuilder
AmqpHeaders.CORRELATION_ID
CorrelationId
/**
* Post-process the given response message before it will be sent.
* <p>
* The default implementation sets the response's correlation id to the request message's correlation id, if any;
* otherwise to the request message id.
* @param request the original incoming Rabbit message
* @param response the outgoing Rabbit message about to be sent
*/
protected void postProcessResponse(Message request, Message response) {
String correlation = request.getMessageProperties().getCorrelationId();
if (correlation == null) {
String messageId = request.getMessageProperties().getMessageId();
if (messageId != null) {
correlation = messageId;
}
}
response.getMessageProperties().setCorrelationId(correlation);
}