I'm using Spring Messaging v 5.3.21 for WebSocket. I have following interceptor to validate each request.
@Override
public Message<?> preSend(Message<?> message, MessageChannel channel) {
try {
StompHeaderAccessor headerAccessor = StompHeaderAccessor.wrap(message);
if (StompCommand.CONNECT.equals(headerAccessor.getCommand())) {
//Validate request
}
} catch (Exception e) {
//exception handling
}
return message;
}
I want to detect internet failure of clients connected to the service.
I'm unable to find any solution to detect internet disconnect on client side.