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.
Author
Rossen Stoyanchev
Since
4.2
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, |
open fun getDefaultHeartbeat(): LongArray
Return the configured default heart-beat value (never |
|
open fun getMessageConverter(): MessageConverter
Return the configured MessageConverter. |
|
open fun getReceiptTimeLimit(): Long
Return the configured receipt time limit. |
|
open fun getTaskScheduler(): TaskScheduler
The configured TaskScheduler. |
|
open fun isDefaultHeartbeatEnabled(): Boolean
Determine whether heartbeats are enabled. Returns |
|
open fun setDefaultHeartbeat(heartbeat: LongArray): Unit
Configure the default value for the "heart-beat" header of the STOMP CONNECT frame. The first number represents how often the client will write or send a heart-beat. The second is how often the server should write. A value of 0 means no heart-beats. By default this is set to "10000,10000" but subclasses may override that default and for example set it to "0,0" if they require a TaskScheduler to be configured first. |
|
open fun setMessageConverter(messageConverter: MessageConverter): Unit
Set the MessageConverter to use to convert the payload of incoming and outgoing messages to and from By default, SimpleMessageConverter is configured. |
|
open fun setReceiptTimeLimit(receiptTimeLimit: Long): Unit
Configure the number of milliseconds before a receipt is considered expired. By default set to 15,000 (15 seconds). |
|
open fun setTaskScheduler(taskScheduler: TaskScheduler): Unit
Configure a scheduler to use for heartbeats and for receipt tracking. Note: Some transports have built-in support to work with heartbeats and therefore do not require a TaskScheduler. Receipts however, if needed, do require a TaskScheduler to be configured. By default, this is not set. |
open class ReactorNettyTcpStompClient : StompClientSupport
A STOMP over TCP client that uses ReactorNettyTcpClient. |
|
open class WebSocketStompClient : StompClientSupport, SmartLifecycle
A STOMP over WebSocket client that connects using an implementation of org.springframework.web.socket.client.WebSocketClient including org.springframework.web.socket.sockjs.client.SockJsClient. |