Fix issue with subscribe destination

The original fix for SPR-11423:
32e5f57e64

was insufficient when using an external broker since the original
destination header has to be in the "native headers" map (i.e. with
STOMP headers) in order to be included in messages broadcast by
the broker.
This commit is contained in:
Rossen Stoyanchev
2014-04-25 12:12:56 -04:00
parent 95b1cb7173
commit 443fb8e4ee
4 changed files with 15 additions and 10 deletions

View File

@@ -156,7 +156,7 @@ public class UserDestinationMessageHandler implements MessageHandler, SmartLifec
}
SimpMessageHeaderAccessor headerAccessor = SimpMessageHeaderAccessor.wrap(message);
if (SimpMessageType.MESSAGE.equals(headerAccessor.getMessageType())) {
headerAccessor.setHeader(SUBSCRIBE_DESTINATION, result.getSubscribeDestination());
headerAccessor.setNativeHeader(SUBSCRIBE_DESTINATION, result.getSubscribeDestination());
message = MessageBuilder.withPayload(message.getPayload()).setHeaders(headerAccessor).build();
}
for (String targetDestination : destinations) {