Top Description Fields Constructors Methods
org.springframework.messaging.simp.stomp

public Class ReactorNettyTcpStompClient

extends StompClientSupport
Class Inheritance
Imports
java.util.concurrent.CompletableFuture, org.springframework.lang.Nullable, org.springframework.messaging.simp.SimpLogging, org.springframework.messaging.tcp.TcpOperations, org.springframework.messaging.tcp.reactor.ReactorNetty2TcpClient, .ReactorNettyTcpClient, org.springframework.util.Assert, .ClassUtils

A STOMP over TCP client, configurable with either ReactorNettyTcpClient or ReactorNetty2TcpClient.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final boolean
private static final boolean
private final TcpOperations<byte[]>

Constructor Summary

AccessConstructor and Description
public
ReactorNettyTcpStompClient()

Create an instance with host "127.0.0.1" and port 61613.

public
ReactorNettyTcpStompClient(String
the host
host
,
int
the port
port
)

Create an instance with the given host and port.

public
ReactorNettyTcpStompClient(TcpOperations<byte[]>
the client to use
tcpClient
)

Create an instance with a pre-configured TCP client.

Method Summary

Modifier and TypeMethod and Description
public ListenableFuture<StompSession>

Returns:

a ListenableFuture for access to the session when ready for use
connect
(StompSessionHandler
the handler for the STOMP session
handler
)

Deprecated since 6.0. as of 6.0, in favor of connectAsync(StompSessionHandler)
Connect and notify the given StompSessionHandler when connected on the STOMP level.
public ListenableFuture<StompSession>

Returns:

a ListenableFuture for access to the session when ready for use
connect
(StompHeaders
headers to add to the CONNECT frame
connectHeaders
,
StompSessionHandler
the handler for the STOMP session
handler
)

Deprecated since 6.0. as of 6.0, in favor of connectAsync(StompHeaders, StompSessionHandler)
An overloaded version of connect(StompSessionHandler) that accepts headers to use for the STOMP CONNECT frame.
public CompletableFuture<StompSession>

Returns:

a CompletableFuture for access to the session when ready for use
connectAsync
(StompSessionHandler
the handler for the STOMP session
handler
)

Connect and notify the given StompSessionHandler when connected on the STOMP level.

public CompletableFuture<StompSession>

Returns:

a CompletableFuture for access to the session when ready for use
connectAsync
(StompHeaders
headers to add to the CONNECT frame
connectHeaders
,
StompSessionHandler
the handler for the STOMP session
handler
)

An overloaded version of connectAsync(StompSessionHandler) that accepts headers to use for the STOMP CONNECT frame.

private static TcpOperations<byte[]>
initTcpClient(String host, int port)

public void
shutdown()

Shut down the client and release resources.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.springframework.messaging.simp.stomp.StompClientSupport:
createSessiongetDefaultHeartbeatgetMessageConvertergetReceiptTimeLimitgetTaskSchedulerisDefaultHeartbeatEnabledprocessConnectHeaderssetDefaultHeartbeatsetMessageConvertersetReceiptTimeLimitsetTaskScheduler

Field Detail

reactorNetty2ClientPresentback to summary
private static final boolean reactorNetty2ClientPresent
reactorNettyClientPresentback to summary
private static final boolean reactorNettyClientPresent
tcpClientback to summary
private final TcpOperations<byte[]> tcpClient

Constructor Detail

ReactorNettyTcpStompClientback to summary
public ReactorNettyTcpStompClient()

Create an instance with host "127.0.0.1" and port 61613.

ReactorNettyTcpStompClientback to summary
public ReactorNettyTcpStompClient(String host, int port)

Create an instance with the given host and port.

Parameters
host:String

the host

port:int

the port

ReactorNettyTcpStompClientback to summary
public ReactorNettyTcpStompClient(TcpOperations<byte[]> tcpClient)

Create an instance with a pre-configured TCP client.

Parameters
tcpClient:TcpOperations<byte[]>

the client to use

Method Detail

connectback to summary
public ListenableFuture<StompSession> connect(StompSessionHandler handler)

Deprecated

since 6.0.

as of 6.0, in favor of connectAsync(StompSessionHandler)

Connect and notify the given StompSessionHandler when connected on the STOMP level.

Parameters
handler:StompSessionHandler

the handler for the STOMP session

Returns:ListenableFuture<StompSession>

a ListenableFuture for access to the session when ready for use

Annotations
@Deprecated
since:6.0
connectback to summary
public ListenableFuture<StompSession> connect(StompHeaders connectHeaders, StompSessionHandler handler)

Deprecated

since 6.0.

as of 6.0, in favor of connectAsync(StompHeaders, StompSessionHandler)

An overloaded version of connect(StompSessionHandler) that accepts headers to use for the STOMP CONNECT frame.

Parameters
connectHeaders:StompHeaders

headers to add to the CONNECT frame

handler:StompSessionHandler

the handler for the STOMP session

Returns:ListenableFuture<StompSession>

a ListenableFuture for access to the session when ready for use

Annotations
@Deprecated
since:6.0
connectAsyncback to summary
public CompletableFuture<StompSession> connectAsync(StompSessionHandler handler)

Connect and notify the given StompSessionHandler when connected on the STOMP level.

Parameters
handler:StompSessionHandler

the handler for the STOMP session

Returns:CompletableFuture<StompSession>

a CompletableFuture for access to the session when ready for use

Since
6.0
connectAsyncback to summary
public CompletableFuture<StompSession> connectAsync(StompHeaders connectHeaders, StompSessionHandler handler)

An overloaded version of connectAsync(StompSessionHandler) that accepts headers to use for the STOMP CONNECT frame.

Parameters
connectHeaders:StompHeaders

headers to add to the CONNECT frame

handler:StompSessionHandler

the handler for the STOMP session

Returns:CompletableFuture<StompSession>

a CompletableFuture for access to the session when ready for use

initTcpClientback to summary
private static TcpOperations<byte[]> initTcpClient(String host, int port)
shutdownback to summary
public void shutdown()

Shut down the client and release resources.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override