public class StompSubProtocolErrorHandler extends java.lang.Object implements SubProtocolErrorHandler<byte[]>
SubProtocolErrorHandler
for use with STOMP.Constructor and Description |
---|
StompSubProtocolErrorHandler() |
Modifier and Type | Method and Description |
---|---|
Message<byte[]> |
handleClientMessageProcessingError(Message<byte[]> clientMessage,
java.lang.Throwable ex)
Handle errors thrown while processing client messages providing an
opportunity to prepare the error message or to prevent one from being sent.
|
Message<byte[]> |
handleErrorMessageToClient(Message<byte[]> errorMessage)
Handle errors sent from the server side to clients, e.g.
|
protected Message<byte[]> |
handleInternal(StompHeaderAccessor errorHeaderAccessor,
byte[] errorPayload,
java.lang.Throwable cause,
StompHeaderAccessor clientHeaderAccessor) |
@Nullable public Message<byte[]> handleClientMessageProcessingError(@Nullable Message<byte[]> clientMessage, java.lang.Throwable ex)
SubProtocolErrorHandler
Note that the STOMP protocol requires a server to close the connection
after sending an ERROR frame. To prevent an ERROR frame from being sent,
a handler could return null
and send a notification message
through the broker instead, e.g. via a user destination.
handleClientMessageProcessingError
in interface SubProtocolErrorHandler<byte[]>
clientMessage
- the client message related to the error, possibly
null
if error occurred while parsing a WebSocket messageex
- the cause for the error, never null
null
in which
case no message will be sent.@Nullable public Message<byte[]> handleErrorMessageToClient(Message<byte[]> errorMessage)
SubProtocolErrorHandler
"broke relay"
because connectivity failed or the external broker sent an
error message, etc.handleErrorMessageToClient
in interface SubProtocolErrorHandler<byte[]>
errorMessage
- the error message, never null
null
in which
case no message will be sent.protected Message<byte[]> handleInternal(StompHeaderAccessor errorHeaderAccessor, byte[] errorPayload, @Nullable java.lang.Throwable cause, @Nullable StompHeaderAccessor clientHeaderAccessor)