spring-framework / org.springframework.messaging.simp.stomp

Package org.springframework.messaging.simp.stomp

Types

BufferingStompDecoder

open class BufferingStompDecoder

An extension of org.springframework.messaging.simp.stomp.StompDecoder that buffers content remaining in the input ByteBuffer after the parent class has read all (complete) STOMP frames from it. The remaining content represents an incomplete STOMP frame. When called repeatedly with additional data, the decode method returns one or more messages or, if there is not enough data still, continues to buffer.

A single instance of this decoder can be invoked repeatedly to read all messages from a single stream (e.g. WebSocket session) as long as decoding does not fail. If there is an exception, StompDecoder instance should not be used any more as its internal state is not guaranteed to be consistent. It is expected that the underlying session is closed at that point.

DefaultStompSession

open class DefaultStompSession : ConnectionHandlingStompSession

Default implementation of ConnectionHandlingStompSession.

ReactorNettyTcpStompClient

open class ReactorNettyTcpStompClient : StompClientSupport

A STOMP over TCP client that uses ReactorNettyTcpClient.

StompClientSupport

abstract class StompClientSupport

Base class for STOMP client implementations.

Subclasses can connect over WebSocket or TCP using any library. When creating a new connection, a subclass can create an instance of @link DefaultStompSession} which extends org.springframework.messaging.tcp.TcpConnectionHandler whose lifecycle methods the subclass must then invoke.

In effect, TcpConnectionHandler and TcpConnection are the contracts that any subclass must adapt to while using StompEncoder and StompDecoder to encode and decode STOMP messages.

StompDecoder

open class StompDecoder

Decodes one or more STOMP frames contained in a ByteBuffer.

An attempt is made to read all complete STOMP frames from the buffer, which could be zero, one, or more. If there is any left-over content, i.e. an incomplete STOMP frame, at the end the buffer is reset to point to the beginning of the partial content. The caller is then responsible for dealing with that incomplete content by buffering until there is more input available.

StompFrameHandler

interface StompFrameHandler

Contract to handle a STOMP frame.

StompHeaderAccessor

open class StompHeaderAccessor : SimpMessageHeaderAccessor

A MessageHeaderAccessor to use when creating a Message from a decoded STOMP frame, or when encoding a Message to a STOMP frame.

When created from STOMP frame content, the actual STOMP headers are stored in the native header sub-map managed by the parent class org.springframework.messaging.support.NativeMessageHeaderAccessor while the parent class SimpMessageHeaderAccessor manages common processing headers some of which are based on STOMP headers (e.g. destination, content-type, etc).

An instance of this class can also be created by wrapping an existing Message. That message may have been created with the more generic org.springframework.messaging.simp.SimpMessageHeaderAccessor in which case STOMP headers are created from common processing headers. In this case it is also necessary to invoke either #updateStompCommandAsClientMessage() or #updateStompCommandAsServerMessage() if sending a message and depending on whether a message is sent to a client or the message broker.

StompReactorNettyCodec

open class StompReactorNettyCodec : AbstractNioBufferReactorNettyCodec<ByteArray>

Simple delegation to StompDecoder and StompEncoder.

StompSessionHandlerAdapter

abstract class StompSessionHandlerAdapter : StompSessionHandler

Abstract adapter class for StompSessionHandler with mostly empty implementation methods except for #getPayloadType which returns String as the default Object type expected for STOMP ERROR frame payloads.

Exceptions

ConnectionLostException

open class ConnectionLostException : RuntimeException

Raised when the connection for a STOMP session is lost rather than closed.

StompConversionException

open class StompConversionException : NestedRuntimeException

Raised after a failure to encode or decode a STOMP message.