springboot version: 2.1.3
spring-websocket version: 5.1.1
spring-cloud-sleuth version: 2.1.1
When I try to use SimpMessagingTemplate.convertAndSend to send a String message to the websocket client after adding spring cloud sleuth to the application, an exception occurs:
Caused by: java.lang.UnsupportedOperationException: null
at java.util.Collections$UnmodifiableMap.remove(Collections.java:1460)
at org.springframework.messaging.support.NativeMessageHeaderAccessor.removeNativeHeader(NativeMessageHeaderAccessor.java:209)
at org.springframework.cloud.sleuth.instrument.messaging.MessageHeaderPropagation.removeAnyTraceHeaders(MessageHeaderPropagation.java:86)
at org.springframework.cloud.sleuth.instrument.messaging.TracingChannelInterceptor.preSend(TracingChannelInterceptor.java:173)
at org.springframework.messaging.support.AbstractMessageChannel$ChannelInterceptorChain.applyPreSend(AbstractMessageChannel.java:178)
at org.springframework.messaging.support.AbstractMessageChannel.send(AbstractMessageChannel.java:132)
... 123 common frames omitted
some primary code belows:
@RequestMapping(value = "/ws/reply", method = RequestMethod.GET)
public String msgReply(@RequestParam String msg) {
System.out.println(msg);
template.convertAndSend("/riten_ws_topic", msg);
return msg;
}
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/riten_ws_topic");
config.setApplicationDestinationPrefixes("/riten_ws_client");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/riten_ws_server").setAllowedOrigins("*").withSockJS();
}
}
springboot version: 2.1.3
spring-websocket version: 5.1.1
spring-cloud-sleuth version: 2.1.1
When I try to use SimpMessagingTemplate.convertAndSend to send a String message to the websocket client after adding spring cloud sleuth to the application, an exception occurs:
some primary code belows: