Class ReactorNetty2TcpClient<P>

java.lang.Object
org.springframework.messaging.tcp.reactor.ReactorNetty2TcpClient<P>
Type Parameters:
P - the type of payload for in and outbound messages
All Implemented Interfaces:
TcpOperations<P>

@Deprecated(since="6.2.18", forRemoval=true) public class ReactorNetty2TcpClient<P> extends Object implements TcpOperations<P>
Deprecated, for removal: This API element is subject to removal in a future version.
as of 6.2.18 with no replacement
Reactor Netty based implementation of TcpOperations.

This class is based on ReactorNettyTcpClient.

Since:
6.0
Author:
Rossen Stoyanchev
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReactorNetty2TcpClient(String host, int port, TcpMessageCodec<P> codec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple constructor with the host and port to use to connect to.
    ReactorNetty2TcpClient(Function<reactor.netty5.tcp.TcpClient,reactor.netty5.tcp.TcpClient> clientConfigurer, TcpMessageCodec<P> codec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    A variant of ReactorNetty2TcpClient(String, int, TcpMessageCodec) that still manages the lifecycle of the TcpClient and underlying resources, but allows for direct configuration of other properties of the client through a Function<TcpClient, TcpClient>.
    ReactorNetty2TcpClient(reactor.netty5.tcp.TcpClient tcpClient, TcpMessageCodec<P> codec)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructor with an externally created TcpClient instance whose lifecycle is expected to be managed externally.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Open a new connection.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Open a new connection and a strategy for reconnecting if the connection fails.
    protected reactor.netty5.tcp.TcpClient
    extendTcpClient(reactor.netty5.tcp.TcpClient tcpClient, TcpConnectionHandler<P> handler)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Provides an opportunity to initialize the TcpClient for the given TcpConnectionHandler which may implement sub-interfaces such as StompTcpConnectionHandler that expose further information.
    org.apache.commons.logging.Log
    Deprecated, for removal: This API element is subject to removal in a future version.
    Return the currently configured Logger.
    void
    setLogger(org.apache.commons.logging.Log logger)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Set an alternative logger to use than the one based on the class name.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Shut down and close any open connections.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.messaging.tcp.TcpOperations

    connect, connect, shutdown
  • Constructor Details

    • ReactorNetty2TcpClient

      public ReactorNetty2TcpClient(String host, int port, TcpMessageCodec<P> codec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Simple constructor with the host and port to use to connect to.

      This constructor manages the lifecycle of the TcpClient and underlying resources such as ConnectionProvider, LoopResources, and ChannelGroup.

      For full control over the initialization and lifecycle of the TcpClient, use ReactorNetty2TcpClient(TcpClient, TcpMessageCodec).

      Parameters:
      host - the host to connect to
      port - the port to connect to
      codec - for encoding and decoding the input/output byte streams
      See Also:
    • ReactorNetty2TcpClient

      public ReactorNetty2TcpClient(Function<reactor.netty5.tcp.TcpClient,reactor.netty5.tcp.TcpClient> clientConfigurer, TcpMessageCodec<P> codec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      A variant of ReactorNetty2TcpClient(String, int, TcpMessageCodec) that still manages the lifecycle of the TcpClient and underlying resources, but allows for direct configuration of other properties of the client through a Function<TcpClient, TcpClient>.
      Parameters:
      clientConfigurer - the configurer function
      codec - for encoding and decoding the input/output byte streams
      Since:
      5.1.3
      See Also:
    • ReactorNetty2TcpClient

      public ReactorNetty2TcpClient(reactor.netty5.tcp.TcpClient tcpClient, TcpMessageCodec<P> codec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructor with an externally created TcpClient instance whose lifecycle is expected to be managed externally.
      Parameters:
      tcpClient - the TcpClient instance to use
      codec - for encoding and decoding the input/output byte streams
      See Also:
  • Method Details

    • setLogger

      public void setLogger(org.apache.commons.logging.Log logger)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set an alternative logger to use than the one based on the class name.
      Parameters:
      logger - the logger to use
      Since:
      5.1
    • getLogger

      public org.apache.commons.logging.Log getLogger()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the currently configured Logger.
      Since:
      5.1
    • connectAsync

      public CompletableFuture<Void> connectAsync(TcpConnectionHandler<P> handler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: TcpOperations
      Open a new connection.
      Specified by:
      connectAsync in interface TcpOperations<P>
      Parameters:
      handler - a handler to manage the connection
      Returns:
      a CompletableFuture that can be used to determine when and if the connection is successfully established
    • extendTcpClient

      protected reactor.netty5.tcp.TcpClient extendTcpClient(reactor.netty5.tcp.TcpClient tcpClient, TcpConnectionHandler<P> handler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provides an opportunity to initialize the TcpClient for the given TcpConnectionHandler which may implement sub-interfaces such as StompTcpConnectionHandler that expose further information.
      Parameters:
      tcpClient - the candidate TcpClient
      handler - the handler for the TCP connection
      Returns:
      the same handler or an updated instance
    • connectAsync

      public CompletableFuture<Void> connectAsync(TcpConnectionHandler<P> handler, ReconnectStrategy strategy)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: TcpOperations
      Open a new connection and a strategy for reconnecting if the connection fails.
      Specified by:
      connectAsync in interface TcpOperations<P>
      Parameters:
      handler - a handler to manage the connection
      strategy - a strategy for reconnecting
      Returns:
      a CompletableFuture that can be used to determine when and if the initial connection is successfully established
    • shutdownAsync

      public CompletableFuture<Void> shutdownAsync()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: TcpOperations
      Shut down and close any open connections.
      Specified by:
      shutdownAsync in interface TcpOperations<P>
      Returns:
      a CompletableFuture that can be used to determine when and if the connection is successfully closed
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class Object