Subclasses can connect over WebSocket or TCP using any library. When creating
a new connection, a subclass can create an instance of DefaultStompSession
which implements org.
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.
| Modifier and Type | Field and Description |
|---|---|
| private long[] | |
| private MessageConverter | |
| private long | |
| private TaskScheduler |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected ConnectionHandlingStompSession | Returns: the created sessionheaders for the STOMP CONNECT frame connectHeaders, StompSessionHandler the handler for the STOMP session handler)Factory method for create and configure a new session. |
| public long[] | |
| public MessageConverter | |
| public long | |
| public TaskScheduler | |
| public boolean | |
| protected StompHeaders | Returns: the modified headersthe headers to modify connectHeaders)Further initialize the StompHeaders, for example setting the heart-beat header if necessary. |
| public void | setDefaultHeartbeat(long[]
the value for the CONNECT "heart-beat" header heartbeat)Configure the default value for the "heart-beat" header of the STOMP CONNECT frame. |
| public void | setMessageConverter(MessageConverter
the message converter to use messageConverter)Set the |
| public void | setReceiptTimeLimit(long receiptTimeLimit)
Configure the number of milliseconds before a receipt is considered expired. |
| public void | setTaskScheduler(TaskScheduler taskScheduler)
Configure a scheduler to use for heartbeats and for receipt tracking. |
| defaultHeartbeat | back to summary |
|---|---|
| private long[] defaultHeartbeat | |
| messageConverter | back to summary |
|---|---|
| private MessageConverter messageConverter | |
| receiptTimeLimit | back to summary |
|---|---|
| private long receiptTimeLimit | |
| taskScheduler | back to summary |
|---|---|
| private TaskScheduler taskScheduler
| |
| StompClientSupport | back to summary |
|---|---|
| public StompClientSupport() | |
| createSession | back to summary |
|---|---|
| protected ConnectionHandlingStompSession createSession(StompHeaders connectHeaders, StompSessionHandler handler) Factory method for create and configure a new session.
| |
| getDefaultHeartbeat | back to summary |
|---|---|
| public long[] getDefaultHeartbeat() Return the configured default heart-beat value (never | |
| getMessageConverter | back to summary |
|---|---|
| public MessageConverter getMessageConverter() Return the configured | |
| getReceiptTimeLimit | back to summary |
|---|---|
| public long getReceiptTimeLimit() Return the configured receipt time limit. | |
| getTaskScheduler | back to summary |
|---|---|
| public TaskScheduler getTaskScheduler() The configured TaskScheduler.
| |
| isDefaultHeartbeatEnabled | back to summary |
|---|---|
| public boolean isDefaultHeartbeatEnabled() Determine whether heartbeats are enabled. Returns | |
| processConnectHeaders | back to summary |
|---|---|
| protected StompHeaders processConnectHeaders(StompHeaders connectHeaders) Further initialize the StompHeaders, for example setting the heart-beat header if necessary.
| |
| setDefaultHeartbeat | back to summary |
|---|---|
| public void setDefaultHeartbeat(long[] heartbeat) 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. Note that a heartbeat is sent only in case of
inactivity, i.e. when no other messages are sent. This can present a
challenge when using an external broker since messages with a non-broker
destination represent activity but aren't actually forwarded to the broker.
In that case you can configure a `TaskScheduler` through the
| |
| setMessageConverter | back to summary |
|---|---|
| public void setMessageConverter(MessageConverter messageConverter) Set the By default,
| |
| setReceiptTimeLimit | back to summary |
|---|---|
| public void setReceiptTimeLimit(long receiptTimeLimit) Configure the number of milliseconds before a receipt is considered expired. By default set to 15,000 (15 seconds). | |
| setTaskScheduler | back to summary |
|---|---|
| public void setTaskScheduler(TaskScheduler taskScheduler) 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. | |