java - Spring 4 - websocket messaging stomp handler -
i trying tutorial provided spring - messaging-stomp-websocket , working fine
now want extend , add websocket handler intercept channel.
public class websockethandlerspring extends textwebsockethandler { @override public void handletextmessage(websocketsession session, textmessage message) { } }
this handler websocketconfig class.
@configuration @enablewebsocketmessagebroker public class websocketconfig extends abstractwebsocketmessagebrokerconfigurer { @override public void configuremessagebroker(messagebrokerregistry config) { config.enablesimplebroker("/topic"); config.setapplicationdestinationprefixes("/app"); } @override public void registerstompendpoints(stompendpointregistry registry) { registry.addendpoint("/hello").withsockjs(); } }
any how configure websockethandlerspring
handler websocketconfig
?
raw websockethandler
support comes @enablewebsocket
(not @enablewebsocketmessagebroker
). need add , implement websocketconfigurer
register endpoints. example here.
Comments
Post a Comment