I have a typical Spring endpoint that serves as a Websocket topic to send messages to (as can be seen in examples at Sending Error message in Spring websockets).
For handling malformed messages that can not be parsed I have created
@MessageExceptionHandler()
public void errorHandler(Exception e, @Headers Map<String, Object> headers) {
LOGGER.error("Bad Packet received: ", e);
}
However I like to have a byte array with the original malformed message, so I can see what exactly was wrong. How can I get it?