Open ingyeoking13 opened 1 week ago
I've modified my WebSocketConfig, but I'm unsure why non-STOMP messages are being received. The code works as expected, though. Apologies if I've raised an incorrect issue.
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
...
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
registration.interceptors(new ChannelInterceptor() {
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
StompHeaderAccessor accessor =
MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
if (accessor == null) {
// If the accessor is null, wrap the message with a new StompHeaderAccessor
// to ensure that the headers are mutable for further processing.
StompHeaderAccessor newAccessor = StompHeaderAccessor.wrap(message);
newAccessor.setLeaveMutable(true);
return MessageBuilder.createMessage(message.getPayload(), newAccessor.getMessageHeaders());
}
// Additional logic here if accessor is not null
}
});
}
}
Based on the provided information it is not possible to tell why this happens. Please provide a minimal application that reproduces the issue along with any necessary instructions if you wish someone to take a look at this.
I'm trying to reproduce error with new project but I found that this is not only problem with stomp + rabbitmq + socket disconnect. I'm still adding adhoc to mimic my origin product to new project to reproduce error
Describe the bug
Opentelemetry Javaagent + rabbit mq stomps get error with following message
It's error from
StompBrokerRelayMessageHandler
classhandleMessageInternal
method.When Client Application disconnect from websocket that is connected, server got extra message with Headers (none
MutableMessageHeaders
). message should type of MutableMessageHeaders and accessor should beStompHeaderAccessor
.Steps to reproduce
When Client Application disconnect from websocket that is connected.
Expected behavior
disconnect websocket gracefully.
Actual behavior
Javaagent or library instrumentation version
2.9.0
Environment
JDK: 17 OS: mac os(intel), linux ubuntu
Additional context
No response