connect() is ultimately called.
Example:
TcpClient.create()
.doOnConnect(connectMetrics)
.doOnConnected(connectedMetrics)
.doOnDisconnected(disconnectedMetrics)
.host("127.0.0.1")
.port(1234)
.secure()
.connect()
.block()
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final TcpClient | Returns: a newTcpClientA supplier of the address to connect to. connectAddressSupplier)
Deprecated
Use
The address to which this client should connect for each subscribe.
remoteAddress(Supplier). This method will be removed in version 1.1.0.
|
| public <A> TcpClient | attr(AttributeKey<A>
the key, A AttributeKey keythe value)AttributeKey valueOverrides reactor. |
| public TcpClient | bindAddress(Supplier<? extends SocketAddress>
A supplier of the address to bind to. bindAddressSupplier)
Set a new local address to which this transport should bind on subscribe.
|
| public final TcpClient | Returns: a newTcpClient
Deprecated
as of 0.9.10. Use the other methods exposed by
Apply a TcpClient to achieve the same configurations.
The method will be removed in version 1.1.0.
Bootstrap mapping function to update TcpClient configuration and
return an enriched TcpClient to use.
|
| public Mono | connect()
Overrides reactor. ClientTransport and return a Mono of Connection.
|
| public final Connection | connectNow()
Overrides reactor. ClientTransport and return a Connection.
|
| public final Connection | connectNow(Duration
connect timeout (resolution: ns) timeout)Overrides reactor. ClientTransport and return a Connection.
|
| public static TcpClient | |
| public static TcpClient | Returns: aTcpClienta provider)ConnectionProvider to acquire connectionsPrepare a |
| public TcpClient | doOnConnect(Consumer<? super TcpClientConfig>
a consumer observing connect events doOnConnect)Overrides reactor. ClientTransport is about to connect to the remote endpoint.
|
| public TcpClient | doOnConnected(Consumer<? super Connection>
a consumer observing connected events doOnConnected)Overrides reactor. Connection has been connected.
|
| public TcpClient | doOnDisconnected(Consumer<? super Connection>
a consumer observing disconnected events doOnDisconnected)Overrides reactor. Connection has been disconnected.
|
| public TcpClient | Returns: a newTcpClientan IO handler that can dispose underlying connection when handler)Publisher terminates.Attach an IO handler to react on connected client. |
| public TcpClient | host(String
the host to connect to host)Overrides reactor. |
| public TcpClient | metrics(boolean
true enables metrics collection; false disables it enable)Overrides reactor. globalRegistry.
|
| public TcpClient | metrics(boolean
if true enables the metrics on the enable, Supplier<? extends ChannelMetricsRecorder> Transport.a supplier for the recorder)ChannelMetricsRecorderOverrides reactor. Transport.
|
| public static TcpClient | |
| public TcpClient | noProxy()
Remove any previously applied Proxy configuration customization.
|
| public TcpClient | |
| public TcpClient | observe(ConnectionObserver
the observer)ConnectionObserver to be set or addOverrides reactor. ConnectionObserver to observe the connection state changes.
|
| public <O> TcpClient | option(ChannelOption<O>
the key, O ChannelOption keythe value)ChannelOption value or nullOverrides reactor. |
| public TcpClient | port(int
the port to connect to port)Overrides reactor. |
| public TcpClient | proxy(Consumer<? super ProxyProvider.
the proxy configuration callback proxyOptions)
Apply a proxy configuration.
|
| public TcpClient | remoteAddress(Supplier<? extends SocketAddress>
A supplier of the address to connect to. remoteAddressSupplier)Overrides reactor. |
| public TcpClient | resolver(AddressResolverGroup<?>
the new resolver)AddressResolverGroupOverrides reactor. AddressResolverGroup.
|
| public TcpClient | runOn(EventLoopGroup
an eventLoopGroup to share eventLoopGroup)Overrides reactor. EventLoopGroup.
|
| public TcpClient | runOn(LoopResources
a channelResources)LoopResources accepting native runtime expectation and
returning an eventLoopGroupOverrides reactor. 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. EventLoopGroup from the LoopResources container.
|
| public TcpClient | |
| public TcpClient | Returns: a newTcpClientbuilder callback for further customization of SslContext. sslProviderBuilder)Apply an SSL configuration customization via the passed builder. |
| public TcpClient | Returns: a newTcpClientThe provider to set when configuring SSL sslProvider)Apply an SSL configuration via the passed |
| public Mono | Returns: aMono representing the completion of the warmupOverrides reactor. Mono that triggers:
|
| public TcpClient | wiretap(boolean
specifies whether the wire logger configuration will be added to the pipeline enable)Overrides reactor. 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. 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. AdvancedByteBufFormat#HEX_DUMP for ByteBuf format,
which means both events and content will be logged and the content will be in hex format.
|
| log | back to summary |
|---|---|
| pack-priv static final Logger log | |
| TcpClient | back to summary |
|---|---|
| public TcpClient() | |
| addressSupplier | back to summary |
|---|---|
| public final TcpClient addressSupplier(Supplier<? extends SocketAddress> connectAddressSupplier)
Deprecated Use The address to which this client should connect for each subscribe.
| |
| attr | back to summary |
|---|---|
| public <A> TcpClient attr(AttributeKey<A> key, A value) Overrides reactor. Doc from reactor. Update the given attribute key or remove it if the value is null.
| |
| bindAddress | back to summary |
|---|---|
| public TcpClient bindAddress(Supplier<? extends SocketAddress> bindAddressSupplier) Overrides reactor. Doc from reactor. Set a new local address to which this transport should bind on subscribe.
| |
| bootstrap | back to summary |
|---|---|
| public final TcpClient bootstrap(Function<? super Bootstrap, ? extends Bootstrap> bootstrapMapper)
Deprecated as of 0.9.10. Use the other methods exposed by Apply a 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 Examples: Configuration via the deprecated '.bootstrap(...)' method
Configuration via the other methods exposed by
Wire logging in plain text
| |
| connect | back to summary |
|---|---|
| public Mono Overrides reactor. Doc from reactor. Connect the
| |
| connectNow | back to summary |
|---|---|
| public final Connection connectNow() Overrides reactor. Doc from reactor. Block the
| |
| connectNow | back to summary |
|---|---|
| public final Connection connectNow(Duration timeout) Overrides reactor. Doc from reactor. Block the
| |
| create | back to summary |
|---|---|
| public static TcpClient create() Prepare a pooled | |
| create | back to summary |
|---|---|
| public static TcpClient create(ConnectionProvider provider) Prepare a
| |
| doOnConnect | back to summary |
|---|---|
| public TcpClient doOnConnect(Consumer<? super TcpClientConfig> doOnConnect) Overrides reactor. Doc from reactor. Set or add a callback called when
| |
| doOnConnected | back to summary |
|---|---|
| public TcpClient doOnConnected(Consumer<? super Connection> doOnConnected) Overrides reactor. Doc from reactor. Set or add a callback called after
| |
| doOnDisconnected | back to summary |
|---|---|
| public TcpClient doOnDisconnected(Consumer<? super Connection> doOnDisconnected) Overrides reactor. Doc from reactor. Set or add a callback called after
| |
| handle | back to summary |
|---|---|
| public TcpClient handle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler) Attach an IO handler to react on connected client.
| |
| host | back to summary |
|---|---|
| public TcpClient host(String host) Overrides reactor. Doc from reactor. The host to which this client should connect.
| |
| metrics | back to summary |
|---|---|
| public TcpClient metrics(boolean enable) Overrides reactor. Doc from reactor. Whether to enable metrics to be collected and registered in Micrometer's
MeterFilter filter = ... ; Metrics.globalRegistry.config().meterFilter(MeterFilter.maximumAllowableTags(prefix, 100, filter)); By default this is not enabled. | |
| metrics | back to summary |
|---|---|
| public TcpClient metrics(boolean enable, Supplier<? extends ChannelMetricsRecorder> recorder) Overrides reactor. Doc from reactor. Specifies whether the metrics are enabled on the
| |
| newConnection | back to summary |
|---|---|
| public static TcpClient newConnection() Prepare a non pooled | |
| noProxy | back to summary |
|---|---|
| public TcpClient noProxy() Overrides reactor. Doc from reactor. Remove any previously applied Proxy configuration customization.
| |
| noSSL | back to summary |
|---|---|
| public TcpClient noSSL() Remove any previously applied SSL configuration customization. | |
| observe | back to summary |
|---|---|
| public TcpClient observe(ConnectionObserver observer) Overrides reactor. Doc from reactor. Set or add the given
| |
| option | back to summary |
|---|---|
| public <O> TcpClient option(ChannelOption<O> key, O value) Overrides reactor. Doc from reactor. Update the given option key or remove it if the value is null. Note Setting
| |
| port | back to summary |
|---|---|
| public TcpClient port(int port) Overrides reactor. Doc from reactor. The port to which this client should connect.
| |
| proxy | back to summary |
|---|---|
| public TcpClient proxy(Consumer<? super ProxyProvider. Overrides reactor. Doc from reactor. Apply a proxy configuration.
| |
| remoteAddress | back to summary |
|---|---|
| public TcpClient remoteAddress(Supplier<? extends SocketAddress> remoteAddressSupplier) Overrides reactor. Doc from reactor. The address to which this client should connect on each subscribe.
| |
| resolver | back to summary |
|---|---|
| public TcpClient resolver(AddressResolverGroup<?> resolver) Overrides reactor. Doc from reactor. Assign an
| |
| runOn | back to summary |
|---|---|
| public TcpClient runOn(EventLoopGroup eventLoopGroup) Overrides reactor. Doc from reactor. Run IO loops on the given
| |
| runOn | back to summary |
|---|---|
| public TcpClient runOn(LoopResources channelResources) Overrides reactor. Doc from reactor. Run IO loops on a supplied
| |
| runOn | back to summary |
|---|---|
| public TcpClient runOn(LoopResources loopResources, boolean preferNative) Overrides reactor. Doc from reactor. Run IO loops on a supplied
| |
| secure | back to summary |
|---|---|
| public TcpClient secure() Enable default sslContext support. The default
| |
| secure | back to summary |
|---|---|
| public TcpClient secure(Consumer<? super SslProvider. Apply an SSL configuration customization via the passed builder. The builder
will produce the
| |
| secure | back to summary |
|---|---|
| public TcpClient secure(SslProvider sslProvider) Apply an SSL configuration via the passed
| |
| warmup | back to summary |
|---|---|
| public Mono Overrides reactor. Based on the actual configuration, returns a
connect operation absorbs the extra time needed to load resources.
| |
| wiretap | back to summary |
|---|---|
| public TcpClient wiretap(boolean enable) Overrides reactor. Doc from reactor. Apply or remove a wire logger configuration using | |
| wiretap | back to summary |
|---|---|
| public TcpClient wiretap(String category) Overrides reactor. Doc from reactor. Apply a wire logger configuration using the specified category (logger),
| |
| wiretap | back to summary |
|---|---|
| public TcpClient wiretap(String category, LogLevel level) Overrides reactor. Doc from reactor. Apply a wire logger configuration using the specified category (logger),
logger level and | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final BiFunction |
| Access | Constructor and Description |
|---|---|
| pack-priv | OnConnectedHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(Connection
the input argument c)Implements java. |
| handler | back to summary |
|---|---|
| pack-priv final BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler | |
| OnConnectedHandle | back to summary |
|---|---|
| pack-priv OnConnectedHandle(BiFunction<? super NettyInbound, ? super NettyOutbound, ? extends Publisher<Void>> handler) | |
| accept | back to summary |
|---|---|
| public void accept(Connection c) Implements java. Doc from java. Performs this operation on the given argument.
| |