Top Description Inners Fields Constructors Methods
reactor.netty.tcp

public abstract Class TcpClient

extends ClientTransport<TcpClient, TcpClientConfig>
Class Inheritance
Known Direct Subclasses
reactor.netty.tcp.TcpClientConnect
Imports
java.net.SocketAddress, java.time.Duration, java.util.function.BiFunction, .Consumer, .Function, .Supplier, io.netty.bootstrap.Bootstrap, io.netty.channel.ChannelOption, .EventLoopGroup, io.netty.handler.logging.LogLevel, io.netty.handler.ssl.JdkSslContext, .OpenSsl, .SslContext, io.netty.resolver.AddressResolverGroup, io.netty.util.AttributeKey, org.reactivestreams.Publisher, reactor.core.publisher.Mono, reactor.netty.Connection, .ConnectionObserver, .NettyInbound, .NettyOutbound, reactor.netty.channel.ChannelMetricsRecorder, reactor.netty.resources.ConnectionProvider, .LoopResources, reactor.netty.transport.ClientTransport, .ProxyProvider, reactor.util.Logger, .Loggers, reactor.util.annotation.Nullable

A TcpClient allows building in a safe immutable way a TCP client that is materialized and connecting when connect() is ultimately called.

Example:

TcpClient.create()
         .doOnConnect(connectMetrics)
         .doOnConnected(connectedMetrics)
         .doOnDisconnected(disconnectedMetrics)
         .host("127.0.0.1")
         .port(1234)
         .secure()
         .connect()
         .block()

Authors
Stephane Maldini, Violeta Georgieva

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final TcpClient

Returns:

a new TcpClient
addressSupplier
(Supplier<? extends SocketAddress>
A supplier of the address to connect to.
connectAddressSupplier
)

Deprecated Use remoteAddress(Supplier). This method will be removed in version 1.1.0.
The address to which this client should connect for each subscribe.
public <A> TcpClient
attr(AttributeKey<A>
the AttributeKey key
key
,
A
the AttributeKey value
value
)

Overrides reactor.netty.transport.Transport.attr.

Update the given attribute key or remove it if the value is null.
public TcpClient
bindAddress(Supplier<? extends SocketAddress>
A supplier of the address to bind to.
bindAddressSupplier
)

Overrides reactor.netty.transport.Transport.bindAddress.

Set a new local address to which this transport should bind on subscribe.
public final TcpClient

Returns:

a new TcpClient
bootstrap
(Function<? super Bootstrap, ? extends Bootstrap>
A Bootstrap mapping function to update TcpClient configuration and return an enriched TcpClient to use.
bootstrapMapper
)

Deprecated as of 0.9.10. Use the other methods exposed by TcpClient to achieve the same configurations. The method will be removed in version 1.1.0.
Apply a Bootstrap mapping function to update TcpClient configuration and return an enriched TcpClient to use.
public Mono<? extends Connection>
public final Connection
public final Connection
connectNow(Duration
connect timeout (resolution: ns)
timeout
)

Overrides reactor.netty.transport.ClientTransport.connectNow.

Block the ClientTransport and return a Connection.
public static TcpClient

Returns:

a TcpClient
create
()

Prepare a pooled TcpClient.

public static TcpClient

Returns:

a TcpClient
create
(ConnectionProvider
a ConnectionProvider to acquire connections
provider
)

Prepare a TcpClient.

public TcpClient
doOnConnect(Consumer<? super TcpClientConfig>
a consumer observing connect events
doOnConnect
)

Overrides reactor.netty.transport.ClientTransport.doOnConnect.

Set or add a callback called when ClientTransport is about to connect to the remote endpoint.
public TcpClient
doOnConnected(Consumer<? super Connection>
a consumer observing connected events
doOnConnected
)

Overrides reactor.netty.transport.ClientTransport.doOnConnected.

Set or add a callback called after Connection has been connected.
public TcpClient
doOnDisconnected(Consumer<? super Connection>
a consumer observing disconnected events
doOnDisconnected
)

Overrides reactor.netty.transport.ClientTransport.doOnDisconnected.

Set or add a callback called after Connection has been disconnected.
public TcpClient

Returns:

a new TcpClient
handle
(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>>
an IO handler that can dispose underlying connection when Publisher terminates.
handler
)

Attach an IO handler to react on connected client.

public TcpClient
host(String
the host to connect to
host
)

Overrides reactor.netty.transport.ClientTransport.host.

The host to which this client should connect.
public TcpClient
metrics(boolean
true enables metrics collection; false disables it
enable
)

Overrides reactor.netty.transport.Transport.metrics.

Whether to enable metrics to be collected and registered in Micrometer's globalRegistry.
public TcpClient
metrics(boolean
if true enables the metrics on the Transport.
enable
,
Supplier<? extends ChannelMetricsRecorder>
a supplier for the ChannelMetricsRecorder
recorder
)

Overrides reactor.netty.transport.Transport.metrics.

Specifies whether the metrics are enabled on the Transport.
public static TcpClient

Returns:

a TcpClient
newConnection
()

Prepare a non pooled TcpClient.

public TcpClient
noProxy()

Overrides reactor.netty.transport.ClientTransport.noProxy.

Remove any previously applied Proxy configuration customization.
public TcpClient

Returns:

a new TcpClient
noSSL
()

Remove any previously applied SSL configuration customization.

public TcpClient
observe(ConnectionObserver
the ConnectionObserver to be set or add
observer
)

Overrides reactor.netty.transport.Transport.observe.

Set or add the given ConnectionObserver to observe the connection state changes.
public <O> TcpClient
option(ChannelOption<O> key, O
the ChannelOption value or null
value
)

Overrides reactor.netty.transport.Transport.option.

Update the given option key or remove it if the value is null.
public TcpClient
port(int
the port to connect to
port
)

Overrides reactor.netty.transport.ClientTransport.port.

The port to which this client should connect.
public TcpClient
proxy(Consumer<? super ProxyProvider.TypeSpec>
the proxy configuration callback
proxyOptions
)

Overrides reactor.netty.transport.ClientTransport.proxy.

Apply a proxy configuration.
public TcpClient
remoteAddress(Supplier<? extends SocketAddress>
A supplier of the address to connect to.
remoteAddressSupplier
)

Overrides reactor.netty.transport.ClientTransport.remoteAddress.

The address to which this client should connect on each subscribe.
public TcpClient
public TcpClient
runOn(EventLoopGroup
an eventLoopGroup to share
eventLoopGroup
)

Overrides reactor.netty.transport.Transport.runOn.

Run IO loops on the given EventLoopGroup.
public TcpClient
runOn(LoopResources
a LoopResources accepting native runtime expectation and returning an eventLoopGroup
channelResources
)

Overrides reactor.netty.transport.Transport.runOn.

Run IO loops on a supplied EventLoopGroup from the LoopResources container.
public TcpClient
runOn(LoopResources
a new loop resources
loopResources
,
boolean
should prefer running on epoll, kqueue or similar instead of java NIO
preferNative
)

Overrides reactor.netty.transport.ClientTransport.runOn.

Run IO loops on a supplied EventLoopGroup from the LoopResources container.
public TcpClient

Returns:

a new TcpClient
secure
()

Enable default sslContext support.

public TcpClient

Returns:

a new TcpClient
secure
(Consumer<? super SslProvider.SslContextSpec>
builder callback for further customization of SslContext.
sslProviderBuilder
)

Apply an SSL configuration customization via the passed builder.

public TcpClient

Returns:

a new TcpClient
secure
(SslProvider
The provider to set when configuring SSL
sslProvider
)

Apply an SSL configuration via the passed SslProvider.

public Mono<Void>

Returns:

a Mono representing the completion of the warmup
warmup
()

Overrides reactor.netty.transport.ClientTransport.warmup.

Based on the actual configuration, returns a Mono that triggers:
  • an initialization of the event loop group
  • an initialization of the host name resolver
  • loads the necessary native libraries for the transport
  • loads the necessary native libraries for the security if there is such
public TcpClient
wiretap(boolean
specifies whether the wire logger configuration will be added to the pipeline
enable
)

Overrides reactor.netty.transport.Transport.wiretap.

Apply or remove a wire logger configuration using Transport category (logger), DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.
public TcpClient
wiretap(String
the logger category
category
)

Overrides reactor.netty.transport.Transport.wiretap.

Apply a wire logger configuration using the specified category (logger), DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.
public TcpClient
wiretap(String
the logger category
category
,
LogLevel
the logger level
level
)

Overrides reactor.netty.transport.Transport.wiretap.

Apply a wire logger configuration using the specified category (logger), logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.
Inherited from reactor.netty.transport.ClientTransport:
doAfterResolvedoOnResolvedoOnResolveErrorproxyWithSystemPropertiesresolver

Field Detail

logback to summary
pack-priv static final Logger log

Hides reactor.netty.transport.Transport.log.

Constructor Detail

TcpClientback to summary
public TcpClient()

Method Detail

addressSupplierback to summary
public final TcpClient addressSupplier(Supplier<? extends SocketAddress> connectAddressSupplier)

Deprecated

Use remoteAddress(Supplier). This method will be removed in version 1.1.0.

The address to which this client should connect for each subscribe.

Parameters
connectAddressSupplier:Supplier<? extends SocketAddress>

A supplier of the address to connect to.

Returns:TcpClient

a new TcpClient

Annotations
@Deprecated
@SuppressWarnings:InlineMeSuggester
attrback to summary
public <A> TcpClient attr(AttributeKey<A> key, A value)

Overrides reactor.netty.transport.Transport.attr.

Doc from reactor.netty.transport.Transport.attr.

Update the given attribute key or remove it if the value is null.

Parameters
<A>
the attribute type
key:AttributeKey<A>

the AttributeKey key

value:A

the AttributeKey value

Returns:TcpClient

a new Transport reference

Annotations
@Override
bindAddressback to summary
public TcpClient bindAddress(Supplier<? extends SocketAddress> bindAddressSupplier)

Overrides reactor.netty.transport.Transport.bindAddress.

Doc from reactor.netty.transport.Transport.bindAddress.

Set a new local address to which this transport should bind on subscribe.

Parameters
bindAddressSupplier:Supplier<? extends SocketAddress>

A supplier of the address to bind to.

Returns:TcpClient

a new Transport

Annotations
@Override
bootstrapback to summary
public final TcpClient bootstrap(Function<? super Bootstrap, ? extends Bootstrap> bootstrapMapper)

Deprecated

as of 0.9.10. Use the other methods exposed by TcpClient to achieve the same configurations. The method will be removed in version 1.1.0.

Apply a Bootstrap mapping function to update TcpClient configuration and return an enriched TcpClient to use.

Note

There isn't only one method that replaces this deprecated method. The configuration that can be done with this deprecated method, can also be done with the other methods exposed by TcpClient.

Examples:

Configuration via the deprecated '.bootstrap(...)' method

TcpClient.bootstrap(b ->
    b.attr(...) // configures the channel attributes
     .group(...) // configures the event loop group
     .handler(...) // configures the channel handler
     .localAddress(...) // configures the bind (local) address
     .option(...) // configures the channel options
     .remoteAddress(...) // configures the remote address
     .resolver(...)) // configures the host names resolver

Configuration via the other methods exposed by TcpClient

TcpClient.attr(...) // configures the channel attributes
         .runOn(...) // configures the event loop group
         .doOnChannelInit(...) // configures the channel handler
         .bindAddress(...) // configures the bind (local) address
         .option(...) // configures the channel options
         .remoteAddress(...) // configures the remote address
         .resolver(...) // configures the host names resolver

Wire logging in plain text

TcpClient.wiretap("logger", LogLevel.DEBUG, AdvancedByteBufFormat.TEXTUAL)

Parameters
bootstrapMapper:Function<? super Bootstrap, ? extends Bootstrap>

A Bootstrap mapping function to update TcpClient configuration and return an enriched TcpClient to use.

Returns:TcpClient

a new TcpClient

Annotations
@Deprecated
@SuppressWarnings:ReturnValueIgnored
connectback to summary
public Mono<? extends Connection> connect()

Overrides reactor.netty.transport.ClientTransport.connect.

Doc from reactor.netty.transport.ClientTransport.connect.

Connect the ClientTransport and return a Mono of Connection. If Mono is cancelled, the underlying connection will be aborted. Once the Connection has been emitted and is not necessary anymore, disposing must be done by the user via Connection#dispose().

Returns:Mono<? extends Connection>

a Mono of Connection

Annotations
@Override
connectNowback to summary
public final Connection connectNow()

Overrides reactor.netty.transport.ClientTransport.connectNow.

Doc from reactor.netty.transport.ClientTransport.connectNow.

Block the ClientTransport and return a Connection. Disposing must be done by the user via Connection#dispose(). The max connection timeout is 45 seconds.

Returns:Connection

a Connection

Annotations
@Override
connectNowback to summary
public final Connection connectNow(Duration timeout)

Overrides reactor.netty.transport.ClientTransport.connectNow.

Doc from reactor.netty.transport.ClientTransport.connectNow.

Block the ClientTransport and return a Connection. Disposing must be done by the user via Connection#dispose().

Parameters
timeout:Duration

connect timeout (resolution: ns)

Returns:Connection

a Connection

Annotations
@Override
createback to summary
public static TcpClient create()

Prepare a pooled TcpClient.

Returns:TcpClient

a TcpClient

createback to summary
public static TcpClient create(ConnectionProvider provider)

Prepare a TcpClient.

Parameters
provider:ConnectionProvider

a ConnectionProvider to acquire connections

Returns:TcpClient

a TcpClient

doOnConnectback to summary
public TcpClient doOnConnect(Consumer<? super TcpClientConfig> doOnConnect)

Overrides reactor.netty.transport.ClientTransport.doOnConnect.

Doc from reactor.netty.transport.ClientTransport.doOnConnect.

Set or add a callback called when ClientTransport is about to connect to the remote endpoint.

Parameters
doOnConnect:Consumer<? super TcpClientConfig>

a consumer observing connect events

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
doOnConnectedback to summary
public TcpClient doOnConnected(Consumer<? super Connection> doOnConnected)

Overrides reactor.netty.transport.ClientTransport.doOnConnected.

Doc from reactor.netty.transport.ClientTransport.doOnConnected.

Set or add a callback called after Connection has been connected.

Parameters
doOnConnected:Consumer<? super Connection>

a consumer observing connected events

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
doOnDisconnectedback to summary
public TcpClient doOnDisconnected(Consumer<? super Connection> doOnDisconnected)

Overrides reactor.netty.transport.ClientTransport.doOnDisconnected.

Doc from reactor.netty.transport.ClientTransport.doOnDisconnected.

Set or add a callback called after Connection has been disconnected.

Parameters
doOnDisconnected:Consumer<? super Connection>

a consumer observing disconnected events

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
handleback to summary
public TcpClient handle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler)

Attach an IO handler to react on connected client.

Parameters
handler:BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>>

an IO handler that can dispose underlying connection when Publisher terminates.

Returns:TcpClient

a new TcpClient

hostback to summary
public TcpClient host(String host)

Overrides reactor.netty.transport.ClientTransport.host.

Doc from reactor.netty.transport.ClientTransport.host.

The host to which this client should connect.

Parameters
host:String

the host to connect to

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
metricsback to summary
public TcpClient metrics(boolean enable)

Overrides reactor.netty.transport.Transport.metrics.

Doc from reactor.netty.transport.Transport.metrics.

Whether to enable metrics to be collected and registered in Micrometer's globalRegistry. Applications can separately register their own filters. For example, to put an upper bound on the number of tags produced:

MeterFilter filter = ... ;
Metrics.globalRegistry.config().meterFilter(MeterFilter.maximumAllowableTags(prefix, 100, filter));

By default this is not enabled.

Parameters
enable:boolean

true enables metrics collection; false disables it

Returns:TcpClient

a new Transport reference

Annotations
@Override
metricsback to summary
public TcpClient metrics(boolean enable, Supplier<? extends ChannelMetricsRecorder> recorder)

Overrides reactor.netty.transport.Transport.metrics.

Doc from reactor.netty.transport.Transport.metrics.

Specifies whether the metrics are enabled on the Transport. All generated metrics are provided to the specified recorder which is only instantiated if metrics are being enabled (the instantiation is not lazy, but happens immediately, while configuring the Transport).

Parameters
enable:boolean

if true enables the metrics on the Transport.

recorder:Supplier<? extends ChannelMetricsRecorder>

a supplier for the ChannelMetricsRecorder

Returns:TcpClient

a new Transport reference

Annotations
@Override
newConnectionback to summary
public static TcpClient newConnection()

Prepare a non pooled TcpClient.

Returns:TcpClient

a TcpClient

noProxyback to summary
public TcpClient noProxy()

Overrides reactor.netty.transport.ClientTransport.noProxy.

Doc from reactor.netty.transport.ClientTransport.noProxy.

Remove any previously applied Proxy configuration customization.

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
noSSLback to summary
public TcpClient noSSL()

Remove any previously applied SSL configuration customization.

Returns:TcpClient

a new TcpClient

observeback to summary
public TcpClient observe(ConnectionObserver observer)

Overrides reactor.netty.transport.Transport.observe.

Doc from reactor.netty.transport.Transport.observe.

Set or add the given ConnectionObserver to observe the connection state changes.

Parameters
observer:ConnectionObserver

the ConnectionObserver to be set or add

Returns:TcpClient

a new Transport reference

Annotations
@Override
optionback to summary
public <O> TcpClient option(ChannelOption<O> key, O value)

Overrides reactor.netty.transport.Transport.option.

Doc from reactor.netty.transport.Transport.option.

Update the given option key or remove it if the value is null.

Note

Setting ChannelOption#AUTO_READ option will be ignored. It is configured to be false.

Parameters
<O>
the option type
key:ChannelOption<O>

the ChannelOption key

value:O

the ChannelOption value or null

Returns:TcpClient

a new Transport reference

Annotations
@Override
portback to summary
public TcpClient port(int port)

Overrides reactor.netty.transport.ClientTransport.port.

Doc from reactor.netty.transport.ClientTransport.port.

The port to which this client should connect.

Parameters
port:int

the port to connect to

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
proxyback to summary
public TcpClient proxy(Consumer<? super ProxyProvider.TypeSpec> proxyOptions)

Overrides reactor.netty.transport.ClientTransport.proxy.

Doc from reactor.netty.transport.ClientTransport.proxy.

Apply a proxy configuration.

Parameters
proxyOptions:Consumer<? super ProxyProvider.TypeSpec>

the proxy configuration callback

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
remoteAddressback to summary
public TcpClient remoteAddress(Supplier<? extends SocketAddress> remoteAddressSupplier)

Overrides reactor.netty.transport.ClientTransport.remoteAddress.

Doc from reactor.netty.transport.ClientTransport.remoteAddress.

The address to which this client should connect on each subscribe.

Parameters
remoteAddressSupplier:Supplier<? extends SocketAddress>

A supplier of the address to connect to.

Returns:TcpClient

a new ClientTransport

Annotations
@Override
resolverback to summary
public TcpClient resolver(AddressResolverGroup<?> resolver)

Overrides reactor.netty.transport.ClientTransport.resolver.

Doc from reactor.netty.transport.ClientTransport.resolver.

Assign an AddressResolverGroup.

Parameters
resolver:AddressResolverGroup<?>

the new AddressResolverGroup

Returns:TcpClient

a new ClientTransport reference

Annotations
@Override
runOnback to summary
public TcpClient runOn(EventLoopGroup eventLoopGroup)

Overrides reactor.netty.transport.Transport.runOn.

Doc from reactor.netty.transport.Transport.runOn.

Run IO loops on the given EventLoopGroup.

Parameters
eventLoopGroup:EventLoopGroup

an eventLoopGroup to share

Returns:TcpClient

a new Transport reference

Annotations
@Override
runOnback to summary
public TcpClient runOn(LoopResources channelResources)

Overrides reactor.netty.transport.Transport.runOn.

Doc from reactor.netty.transport.Transport.runOn.

Run IO loops on a supplied EventLoopGroup from the LoopResources container. Will prefer native (epoll/kqueue) implementation if available unless the environment property reactor.netty.native is set to false.

Parameters
channelResources:LoopResources

a LoopResources accepting native runtime expectation and returning an eventLoopGroup

Returns:TcpClient

a new Transport reference

Annotations
@Override
runOnback to summary
public TcpClient runOn(LoopResources loopResources, boolean preferNative)

Overrides reactor.netty.transport.ClientTransport.runOn.

Doc from reactor.netty.transport.Transport.runOn.

Run IO loops on a supplied EventLoopGroup from the LoopResources container.

Parameters
loopResources:LoopResources

a new loop resources

preferNative:boolean

should prefer running on epoll, kqueue or similar instead of java NIO

Returns:TcpClient

a new Transport reference

Annotations
@Override
secureback to summary
public TcpClient secure()

Enable default sslContext support. The default SslContext will be assigned to with a default value of:

  • 10 seconds handshake timeout unless the environment property reactor.netty.tcp.sslHandshakeTimeout is set.
  • 3 seconds close_notify flush timeout
  • 0 second close_notify read timeout
Returns:TcpClient

a new TcpClient

secureback to summary
public TcpClient secure(Consumer<? super SslProvider.SslContextSpec> sslProviderBuilder)

Apply an SSL configuration customization via the passed builder. The builder will produce the SslContext to be passed to with a default value of:

  • 10 seconds handshake timeout unless the environment property reactor.netty.tcp.sslHandshakeTimeout is set.
  • 3 seconds close_notify flush timeout
  • 0 second close_notify read timeout
Parameters
sslProviderBuilder:Consumer<? super SslProvider.SslContextSpec>

builder callback for further customization of SslContext.

Returns:TcpClient

a new TcpClient

secureback to summary
public TcpClient secure(SslProvider sslProvider)

Apply an SSL configuration via the passed SslProvider.

Parameters
sslProvider:SslProvider

The provider to set when configuring SSL

Returns:TcpClient

a new TcpClient

warmupback to summary
public Mono<Void> warmup()

Overrides reactor.netty.transport.ClientTransport.warmup.

Based on the actual configuration, returns a Mono that triggers:

  • an initialization of the event loop group
  • an initialization of the host name resolver
  • loads the necessary native libraries for the transport
  • loads the necessary native libraries for the security if there is such
By default, when method is not used, the connect operation absorbs the extra time needed to load resources.
Returns:Mono<Void>

a Mono representing the completion of the warmup

Annotations
@Override
Since
1.0.3
wiretapback to summary
public TcpClient wiretap(boolean enable)

Overrides reactor.netty.transport.Transport.wiretap.

Doc from reactor.netty.transport.Transport.wiretap.

Apply or remove a wire logger configuration using Transport category (logger), DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.

Parameters
enable:boolean

specifies whether the wire logger configuration will be added to the pipeline

Returns:TcpClient

a new Transport reference

Annotations
@Override
wiretapback to summary
public TcpClient wiretap(String category)

Overrides reactor.netty.transport.Transport.wiretap.

Doc from reactor.netty.transport.Transport.wiretap.

Apply a wire logger configuration using the specified category (logger), DEBUG logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.

Parameters
category:String

the logger category

Returns:TcpClient

a new Transport reference

Annotations
@Override
wiretapback to summary
public TcpClient wiretap(String category, LogLevel level)

Overrides reactor.netty.transport.Transport.wiretap.

Doc from reactor.netty.transport.Transport.wiretap.

Apply a wire logger configuration using the specified category (logger), logger level and AdvancedByteBufFormat#HEX_DUMP for ByteBuf format, which means both events and content will be logged and the content will be in hex format.

Parameters
category:String

the logger category

level:LogLevel

the logger level

Returns:TcpClient

a new Transport reference

Annotations
@Override
reactor.netty.tcp back to summary

pack-priv final Class TcpClient.OnConnectedHandle

extends Object
implements Consumer<Connection>
Class Inheritance
All Implemented Interfaces
java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
pack-priv final BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>>

Constructor Summary

AccessConstructor and Description
pack-priv
OnConnectedHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler)

Method Summary

Modifier and TypeMethod and Description
public void
accept(Connection
the input argument
c
)

Implements java.util.function.Consumer.accept.

Performs this operation on the given argument.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlerback to summary
pack-priv final BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler

Constructor Detail

OnConnectedHandleback to summary
pack-priv OnConnectedHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler)

Method Detail

acceptback to summary
public void accept(Connection c)

Implements java.util.function.Consumer.accept.

Doc from java.util.function.Consumer.accept.

Performs this operation on the given argument.

Parameters
c:Connection

the input argument

Annotations
@Override