Backport of STOMP message header encoding improvements

Issue: SPR-14901
This commit is contained in:
Rossen Stoyanchev
2016-12-08 11:33:16 -05:00
parent 5700d65a53
commit 69ba85b051
2 changed files with 78 additions and 9 deletions

View File

@@ -97,9 +97,9 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
@SuppressWarnings("deprecation")
private org.springframework.messaging.simp.user.UserSessionRegistry userSessionRegistry;
private final StompEncoder stompEncoder = new StompEncoder();
private StompEncoder stompEncoder = new StompEncoder();
private final StompDecoder stompDecoder = new StompDecoder();
private StompDecoder stompDecoder = new StompDecoder();
private final Map<String, BufferingStompDecoder> decoders = new ConcurrentHashMap<String, BufferingStompDecoder>();
@@ -171,6 +171,24 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
return this.userSessionRegistry;
}
/**
* Configure a {@link StompEncoder} for encoding STOMP frames
* @param encoder the encoder
* @since 4.3.5
*/
public void setEncoder(StompEncoder encoder) {
this.stompEncoder = encoder;
}
/**
* Configure a {@link StompDecoder} for decoding STOMP frames
* @param decoder the decoder
* @since 4.3.5
*/
public void setDecoder(StompDecoder decoder) {
this.stompDecoder = decoder;
}
/**
* Configure a {@link MessageHeaderInitializer} to apply to the headers of all
* messages created from decoded STOMP frames and other messages sent to the