Class ReactorNettyTcpStompClient
java.lang.Object
org.springframework.messaging.simp.stomp.StompClientSupport
org.springframework.messaging.simp.stomp.ReactorNettyTcpStompClient
A STOMP over TCP client, configurable with either
ReactorNettyTcpClient
or ReactorNetty2TcpClient
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionCreate an instance with host "127.0.0.1" and port 61613.ReactorNettyTcpStompClient
(String host, int port) Create an instance with the given host and port.ReactorNettyTcpStompClient
(TcpOperations<byte[]> tcpClient) Create an instance with a pre-configured TCP client. -
Method Summary
Modifier and TypeMethodDescriptionconnect
(StompHeaders connectHeaders, StompSessionHandler handler) Deprecated.connect
(StompSessionHandler handler) Deprecated.as of 6.0, in favor ofconnectAsync(StompSessionHandler)
connectAsync
(StompHeaders connectHeaders, StompSessionHandler handler) An overloaded version ofconnectAsync(StompSessionHandler)
that accepts headers to use for the STOMP CONNECT frame.connectAsync
(StompSessionHandler handler) Connect and notify the givenStompSessionHandler
when connected on the STOMP level.void
shutdown()
Shut down the client and release resources.toString()
Methods inherited from class org.springframework.messaging.simp.stomp.StompClientSupport
createSession, getDefaultHeartbeat, getMessageConverter, getReceiptTimeLimit, getTaskScheduler, isDefaultHeartbeatEnabled, processConnectHeaders, setDefaultHeartbeat, setMessageConverter, setReceiptTimeLimit, setTaskScheduler
-
Constructor Details
-
ReactorNettyTcpStompClient
public ReactorNettyTcpStompClient()Create an instance with host "127.0.0.1" and port 61613. -
ReactorNettyTcpStompClient
Create an instance with the given host and port.- Parameters:
host
- the hostport
- the port
-
ReactorNettyTcpStompClient
Create an instance with a pre-configured TCP client.- Parameters:
tcpClient
- the client to use
-
-
Method Details
-
connect
Deprecated.as of 6.0, in favor ofconnectAsync(StompSessionHandler)
Connect and notify the givenStompSessionHandler
when connected on the STOMP level.- Parameters:
handler
- the handler for the STOMP session- Returns:
- a ListenableFuture for access to the session when ready for use
-
connectAsync
Connect and notify the givenStompSessionHandler
when connected on the STOMP level.- Parameters:
handler
- the handler for the STOMP session- Returns:
- a CompletableFuture for access to the session when ready for use
- Since:
- 6.0
-
connect
@Deprecated(since="6.0") public ListenableFuture<StompSession> connect(@Nullable StompHeaders connectHeaders, StompSessionHandler handler) Deprecated.as of 6.0, in favor ofconnectAsync(StompHeaders, StompSessionHandler)
An overloaded version ofconnect(StompSessionHandler)
that accepts headers to use for the STOMP CONNECT frame.- Parameters:
connectHeaders
- headers to add to the CONNECT framehandler
- the handler for the STOMP session- Returns:
- a ListenableFuture for access to the session when ready for use
-
connectAsync
public CompletableFuture<StompSession> connectAsync(@Nullable StompHeaders connectHeaders, StompSessionHandler handler) An overloaded version ofconnectAsync(StompSessionHandler)
that accepts headers to use for the STOMP CONNECT frame.- Parameters:
connectHeaders
- headers to add to the CONNECT framehandler
- the handler for the STOMP session- Returns:
- a CompletableFuture for access to the session when ready for use
-
shutdown
public void shutdown()Shut down the client and release resources. -
toString
-
connectAsync(StompHeaders, StompSessionHandler)