You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that only one messageHandler is registered by AbstractNettyWebSocketHandler. After the decode all message types (not PONG) are handled by the last @OnMessage implementation.
Is expected that:
Each websocket endpoint may only have one message handling method for each of the native websocket message formats: text, binary and pong. The websocket implementation must not deploy such an endpoint and must raise a deployment error if an attemp tis made to deploy such an annotated endpoint.[WSC-4.7-4]
How to configure or implement the ServerWebSocket to be able to use separated handlers @OnMessage methods for Text and for Binary?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would use a websocket endpoint to handle method of the native websocket message formats text and binary.
ServerWebSocket {
.....
@OnMessage
public void onMessageText(String messageString, String user, String topic) {...}
@OnMessage
public void onMessageData(byte[] messageString, String user, String topic) {...}
}
The problem is that only one
messageHandler
is registered by AbstractNettyWebSocketHandler. After the decode all message types (not PONG) are handled by the last @OnMessage implementation.Is expected that:
Each websocket endpoint may only have one message handling method for each of the native websocket message formats: text, binary and pong. The websocket implementation must not deploy such an endpoint and must raise a deployment error if an attemp tis made to deploy such an annotated endpoint.[WSC-4.7-4]
How to configure or implement the ServerWebSocket to be able to use separated handlers @OnMessage methods for Text and for Binary?
Beta Was this translation helpful? Give feedback.
All reactions