0

I can't find examples of use of stompSubProtocolHandler and SubProtocolWebSocketHandler?

I need extend this SubProtocolWebSocketHandler class?

private static class ProducerStompSessionHandler2 extends SubProtocolWebSocketHandler {

        public ProducerStompSessionHandler2(MessageChannel clientInboundChannel,
                SubscribableChannel clientOutboundChannel) {
            super(clientInboundChannel, clientOutboundChannel);
            // TODO Auto-generated constructor stub
        }


    }

I'm using a handler for a Sockjs java client that extend of StompSessionHandlerAdapter and is working. I can connect, subscribe and send messages:

private static class ProducerStompSessionHandler extends StompSessionHandlerAdapter { ...

}

But I see another user telling that there are two implementacions: SubProtocolWebSocketHandler and stompSubProtocolHandler. https://stackoverflow.com/a/28306539/6243317

These are implementation of Java Websocket over STOMP clients? how use? advantages? why use this implementation?

Community
  • 1
  • 1
Sergio
  • 441
  • 9
  • 22

1 Answers1

0

To answer your main question in the title, I think this sample by Spring would be useful to you. The stompSubProtocolHandler is more server side in the sample, but I assume the logic will be the same for client.

mor
  • 21
  • 1
  • 4