public class StompSubProtocolErrorHandler extends Object implements SubProtocolErrorHandler<byte[]>
SubProtocolErrorHandler
for use with STOMP.Constructor and Description |
---|
StompSubProtocolErrorHandler() |
Modifier and Type | Method and Description |
---|---|
org.springframework.messaging.Message<byte[]> |
handleClientMessageProcessingError(org.springframework.messaging.Message<byte[]> clientMessage,
Throwable ex)
Handle errors thrown while processing client messages providing an
opportunity to prepare the error message or to prevent one from being sent.
|
org.springframework.messaging.Message<byte[]> |
handleErrorMessageToClient(org.springframework.messaging.Message<byte[]> errorMessage)
Handle errors sent from the server side to clients, e.g.
|
protected org.springframework.messaging.Message<byte[]> |
handleInternal(org.springframework.messaging.simp.stomp.StompHeaderAccessor errorHeaderAccessor,
byte[] errorPayload,
Throwable cause,
org.springframework.messaging.simp.stomp.StompHeaderAccessor clientHeaderAccessor) |
public org.springframework.messaging.Message<byte[]> handleClientMessageProcessingError(org.springframework.messaging.Message<byte[]> clientMessage, 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.public org.springframework.messaging.Message<byte[]> handleErrorMessageToClient(org.springframework.messaging.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 org.springframework.messaging.Message<byte[]> handleInternal(org.springframework.messaging.simp.stomp.StompHeaderAccessor errorHeaderAccessor, byte[] errorPayload, Throwable cause, org.springframework.messaging.simp.stomp.StompHeaderAccessor clientHeaderAccessor)