类 ReactorNettyTcpStompClient
- java.lang.Object
- org.springframework.messaging.simp.stomp.StompClientSupport
- org.springframework.messaging.simp.stomp.ReactorNettyTcpStompClient
public class ReactorNettyTcpStompClient extends StompClientSupport
A STOMP over TCP client that usesReactorNettyTcpClient
.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 ReactorNettyTcpStompClient()
Create 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ListenableFuture<StompSession>
connect(StompHeaders connectHeaders, StompSessionHandler handler)
An overloaded version ofconnect(StompSessionHandler)
that accepts headers to use for the STOMP CONNECT frame.ListenableFuture<StompSession>
connect(StompSessionHandler handler)
Connect and notify the givenStompSessionHandler
when connected on the STOMP level.void
shutdown()
Shut down the client and release resources.String
toString()
从类继承的方法 org.springframework.messaging.simp.stomp.StompClientSupport
createSession, getDefaultHeartbeat, getMessageConverter, getReceiptTimeLimit, getTaskScheduler, isDefaultHeartbeatEnabled, processConnectHeaders, setDefaultHeartbeat, setMessageConverter, setReceiptTimeLimit, setTaskScheduler
构造器详细资料
ReactorNettyTcpStompClient
public ReactorNettyTcpStompClient()
Create an instance with host "127.0.0.1" and port 61613.
ReactorNettyTcpStompClient
public ReactorNettyTcpStompClient(String host, int port)
Create an instance with the given host and port.- 参数:
host
- the hostport
- the port
ReactorNettyTcpStompClient
public ReactorNettyTcpStompClient(TcpOperations<byte[]> tcpClient)
Create an instance with a pre-configured TCP client.- 参数:
tcpClient
- the client to use
方法详细资料
connect
public ListenableFuture<StompSession> connect(StompSessionHandler handler)
Connect and notify the givenStompSessionHandler
when connected on the STOMP level.- 参数:
handler
- the handler for the STOMP session- 返回:
- a ListenableFuture for access to the session when ready for use
connect
public ListenableFuture<StompSession> connect(@Nullable StompHeaders connectHeaders, StompSessionHandler handler)
An overloaded version ofconnect(StompSessionHandler)
that accepts headers to use for the STOMP CONNECT frame.- 参数:
connectHeaders
- headers to add to the CONNECT framehandler
- the handler for the STOMP session- 返回:
- a ListenableFuture for access to the session when ready for use
shutdown
public void shutdown()
Shut down the client and release resources.