Interface StompSessionHandler
- All Superinterfaces:
- StompFrameHandler
- All Known Implementing Classes:
- StompSessionHandlerAdapter
A contract for client STOMP session lifecycle events including a callback
 when the session is established and notifications of transport or message
 handling failures.
 
This contract also extends StompFrameHandler in order to handle
 STOMP ERROR frames received from the broker.
 
Implementations of this interface should consider extending
 StompSessionHandlerAdapter.
- Since:
- 4.2
- Author:
- Rossen Stoyanchev
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidafterConnected(StompSession session, StompHeaders connectedHeaders) Invoked when the session is ready to use, i.e.voidhandleException(StompSession session, StompCommand command, StompHeaders headers, byte[] payload, Throwable exception) Handle any exception arising while processing a STOMP frame such as a failure to convert the payload or an unhandled exception in the applicationStompFrameHandler.voidhandleTransportError(StompSession session, Throwable exception) Handle a low level transport error which could be an I/O error or a failure to encode or decode a STOMP message.Methods inherited from interface org.springframework.messaging.simp.stomp.StompFrameHandlergetPayloadType, handleFrame
- 
Method Details- 
afterConnectedInvoked when the session is ready to use, i.e. after the underlying transport (TCP, WebSocket) is connected and a STOMP CONNECTED frame is received from the broker.- Parameters:
- session- the client STOMP session
- connectedHeaders- the STOMP CONNECTED frame headers
 
- 
handleExceptionvoid handleException(StompSession session, @Nullable StompCommand command, StompHeaders headers, byte[] payload, Throwable exception) Handle any exception arising while processing a STOMP frame such as a failure to convert the payload or an unhandled exception in the applicationStompFrameHandler.- Parameters:
- session- the client STOMP session
- command- the STOMP command of the frame
- headers- the headers
- payload- the raw payload
- exception- the exception
 
- 
handleTransportErrorHandle a low level transport error which could be an I/O error or a failure to encode or decode a STOMP message.Note that ConnectionLostExceptionwill be passed into this method when the connection is lost rather than closed normally viaStompSession.disconnect().- Parameters:
- session- the client STOMP session
- exception- the exception that occurred
 
 
-