Received message's destination is default for resp
When an annotated handler returns a Message from a @SubscribeEvent or @MessageMapping method and it contains no destination in its headers, use the received message's destination as the response message's destination.
This commit is contained in:
parent
7bb3b824c3
commit
f6398e14d0
|
@ -84,6 +84,10 @@ public class MessageReturnValueHandler implements ReturnValueHandler {
|
|||
returnHeaders.setSessionId(sessionId);
|
||||
returnHeaders.setSubscriptionId(subscriptionId);
|
||||
|
||||
if (returnHeaders.getDestination() == null) {
|
||||
returnHeaders.setDestination(headers.getDestination());
|
||||
}
|
||||
|
||||
Object payload = returnMessage.getPayload();
|
||||
return MessageBuilder.fromPayloadAndHeaders(payload, returnHeaders.toMessageHeaders()).build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue