Spring Websocket Stomp handle CONNECT frame -
is there way intercept stomp connect
frame in spring , refuse under conditions? interception can done using sessionconnectevent
allow or refuse connection based on headers. cannot in sessionconnectevent
listener.
if take stompsubprotocolhandler
code, we'll see this:
try { simpattributescontextholder.setattributesfrommessage(message); if (this.eventpublisher != null) { if (stompcommand.connect.equals(headeraccessor.getcommand())) { publishevent(new sessionconnectevent(this, message, user)); } ........ outputchannel.send(message); }
so, connect
frame not emitted sessionconnectevent
, sent clientinboundchannel
well.
so, need achieve requirement providing custom channelinterceptor
presend
implementation , register overriding websocketmessagebrokerconfigurer.configureclientinboundchannel
.
Comments
Post a Comment