spring-framework / org.springframework.messaging.tcp.reactor / ReactorNettyTcpClient

ReactorNettyTcpClient

open class ReactorNettyTcpClient<P : Any> : TcpOperations<P>

Reactor Netty based implementation of TcpOperations.

Author
Rossen Stoyanchev

Author
Stephane Maldini

Since
5.0

Constructors

<init>

ReactorNettyTcpClient(host: String, port: Int, codec: ReactorNettyCodec<P>)

Simple constructor with a host and a port.

ReactorNettyTcpClient(optionsConsumer: Consumer<Builder<*>>, codec: ReactorNettyCodec<P>)

Constructor with a ClientOptions.Builder that can be used to customize Reactor Netty client options.

Note: this constructor manages the lifecycle of the TcpClient and its underlying resources. Please do not customize any of the following options: ChannelGroup, LoopResources, and PoolResources. You may set the disablePool option if you simply want to turn off pooling.

For full control over the initialization and lifecycle of the TcpClient, see #ReactorNettyTcpClient(TcpClient, ReactorNettyCodec).

ReactorNettyTcpClient(tcpClient: TcpClient, codec: ReactorNettyCodec<P>)

Constructor with an externally created TcpClient instance whose lifecycle is expected to be managed externally.

Functions

connect

open fun connect(handler: TcpConnectionHandler<P>): ListenableFuture<Void>
open fun connect(handler: TcpConnectionHandler<P>, strategy: ReconnectStrategy): ListenableFuture<Void>

shutdown

open fun shutdown(): ListenableFuture<Void>