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.
Author
Rossen Stoyanchev
Since
4.2
WebSocketStompClient(webSocketClient: WebSocketClient)
Class constructor. Sets |
open fun connect(url: String, handler: StompSessionHandler, vararg uriVars: Any): ListenableFuture<StompSession>
Connect to the given WebSocket URL and notify the given org.springframework.messaging.simp.stomp.StompSessionHandler when connected on the STOMP level after the CONNECTED frame is received. open fun connect(url: String, handshakeHeaders: WebSocketHttpHeaders, handler: StompSessionHandler, vararg uriVariables: Any): ListenableFuture<StompSession>
An overloaded version of open fun connect(url: String, handshakeHeaders: WebSocketHttpHeaders, connectHeaders: StompHeaders, handler: StompSessionHandler, vararg uriVariables: Any): ListenableFuture<StompSession>
An overloaded version of open fun connect(url: URI, handshakeHeaders: WebSocketHttpHeaders, connectHeaders: StompHeaders, sessionHandler: StompSessionHandler): ListenableFuture<StompSession>
An overloaded version of |
|
open fun getInboundMessageSizeLimit(): Int
Get the configured inbound message buffer size in bytes. |
|
open fun getPhase(): Int
Return the configured phase. |
|
open fun getWebSocketClient(): WebSocketClient
Return the configured WebSocketClient. |
|
open fun isAutoStartup(): Boolean
Return the value for the 'autoStartup' property. If "true", this client will automatically start and stop the contained WebSocketClient. |
|
open fun isRunning(): Boolean |
|
open fun setAutoStartup(autoStartup: Boolean): Unit
Set whether to auto-start the contained WebSocketClient when the Spring context has been refreshed. Default is "true". |
|
open fun setInboundMessageSizeLimit(inboundMessageSizeLimit: Int): Unit
Configure the maximum size allowed for inbound STOMP message. Since a STOMP message can be received in multiple WebSocket messages, buffering may be required and this property determines the maximum buffer size per message. By default this is set to 64 * 1024 (64K). |
|
open fun setPhase(phase: Int): Unit
Specify the phase in which the WebSocket client should be started and subsequently closed. The startup order proceeds from lowest to highest, and the shutdown order is the reverse of that. By default this is Integer.MAX_VALUE meaning that the WebSocket client is started as late as possible and stopped as soon as possible. |
|
open fun setTaskScheduler(taskScheduler: TaskScheduler): Unit
{@inheritDoc} Also automatically sets the |
|
open fun start(): Unit |
|
open fun stop(): Unitopen fun stop(callback: Runnable): Unit |
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). |