Class ClientFactoryOptions
- All Implemented Interfaces:
Iterable<ClientFactoryOptionValue<Object>>
ClientFactoryOption
s and their respective values.-
Field Summary
Modifier and TypeFieldDescriptionstatic final ClientFactoryOption
<Function<? super EventLoopGroup, ? extends AddressResolverGroup<? extends InetSocketAddress>>> The factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es.static final ClientFactoryOption
<Map<ChannelOption<?>, Object>> TheChannelOption
s of the sockets created by theClientFactory
.static final ClientFactoryOption
<Consumer<? super ChannelPipeline>> TheConsumer
that customizes the NettyChannelPipeline
.static final ClientFactoryOption
<OutlierDetection> TheOutlierDetection
which is used to detect unhealthy connections.static final ClientFactoryOption
<ConnectionPoolListener> The listener which is notified on a connection pool event.static final ClientFactoryOption
<Function<? super EventLoopGroup, ? extends EventLoopScheduler>> The factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
.static final ClientFactoryOption
<Http1HeaderNaming> TheHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another HTTP/1 header name.static final ClientFactoryOption
<Integer> The maximum length of each chunk in an HTTP/1 response content.static final ClientFactoryOption
<Integer> The maximum length of all headers in an HTTP/1 response.static final ClientFactoryOption
<Integer> The maximum length of an HTTP/1 response initial line.static final ClientFactoryOption
<Long> The graceful connection shutdown timeout in milliseconds..static final ClientFactoryOption
<Integer> The HTTP/2 initial connection flow-control window size.static final ClientFactoryOption
<Integer> The SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control.static final ClientFactoryOption
<Integer> The SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive.static final ClientFactoryOption
<Long> The HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets.static final ClientFactoryOption
<Long> The idle timeout of a socket connection in milliseconds.static final ClientFactoryOption
<Boolean> If the idle timeout is reset when an HTTP/2 PING frame or the response of"OPTIONS * HTTP/1.1"
is received.static final ClientFactoryOption
<Long> The client-side max age of a connection for keep-alive in milliseconds.static final ClientFactoryOption
<Integer> The client-side maximum allowed number of requests that can be sent through one connection.static final ClientFactoryOption
<MeterRegistry> TheMeterRegistry
which collects various stats.static final ClientFactoryOption
<Long> The PING interval in milliseconds.static final ClientFactoryOption
<Boolean> Whether to use HTTP/1.1 instead of HTTP/2.static final ClientFactoryOption
<ProxyConfigSelector> TheProxyConfigSelector
which determines theProxyConfig
to be used.static final ClientFactoryOption
<Boolean> Whether to shut down the workerEventLoopGroup
when theClientFactory
is closed.static final ClientFactoryOption
<Boolean> Deprecated.It's not recommended to enable this option.static final ClientFactoryOption
<Consumer<? super SslContextBuilder>> TheConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session.static final ClientFactoryOption
<TlsEngineType> TheTlsEngineType
that will be used for processing TLS connections.static final ClientFactoryOption
<Boolean> Whether to use HTTP pipelining for HTTP/1 connections.static final ClientFactoryOption
<Boolean> Whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection.static final ClientFactoryOption
<Boolean> Whether to use HTTP/2 without ALPN.static final ClientFactoryOption
<EventLoopGroup> The workerEventLoopGroup
. -
Method Summary
Modifier and TypeMethodDescriptionFunction
<? super EventLoopGroup, ? extends AddressResolverGroup<? extends InetSocketAddress>> Returns the factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es.Map
<ChannelOption<?>, Object> Returns theChannelOption
s of the sockets created by theClientFactory
.Consumer
<? super ChannelPipeline> TheConsumer
that customizes the NettyChannelPipeline
.Returns theOutlierDetection
which is used to detect unhealthy connections.Returns the listener which is notified on a connection pool event.Function
<? super EventLoopGroup, ? extends EventLoopScheduler> Returns the factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
.Returns theHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another header name.int
Returns the maximum length of each chunk in an HTTP/1 response content.int
Returns the maximum length of all headers in an HTTP/1 response.int
Returns the maximum length of an HTTP/1 response initial line.long
Returns the graceful connection shutdown timeout in milliseconds.int
Returns the HTTP/2 initial connection flow-control window size.int
Returns the SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control.int
Returns the SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive.long
Returns the HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets.long
Returns the idle timeout of a socket connection in milliseconds.boolean
Returns whether to keep connection alive when an HTTP/2 PING frame or the response of"OPTIONS * HTTP/1.1"
is received.long
Returns the client-side max age of a connection for keep-alive in milliseconds.int
Returns the client-side maximum allowed number of requests that can be sent through one connection.Returns theMeterRegistry
which collects various stats.static ClientFactoryOptions
of()
Returns an empty singletonClientFactoryOptions
.static ClientFactoryOptions
of
(ClientFactoryOptions baseOptions, ClientFactoryOptionValue<?>... additionalValues) Merges the specifiedClientFactoryOptions
andClientFactoryOptionValue
s.static ClientFactoryOptions
of
(ClientFactoryOptions baseOptions, Iterable<? extends ClientFactoryOptionValue<?>> additionalValues) Merges the specifiedClientFactoryOptions
andClientFactoryOptionValue
s.static ClientFactoryOptions
of
(ClientFactoryOptionValue<?>... values) Returns theClientFactoryOptions
with the specifiedClientFactoryOptionValue
s.static ClientFactoryOptions
of
(Iterable<? extends ClientFactoryOptionValue<?>> values) Returns theClientFactoryOptions
with the specifiedClientFactoryOptionValue
s.long
Returns the PING interval in milliseconds.boolean
Returns whether to use HTTP/1.1 instead of HTTP/2 .TheProxyConfigSelector
which determines theProxyConfig
to be used.boolean
Returns the flag whether to shut down the workerEventLoopGroup
when theClientFactory
is closed.boolean
Returns whether to allow the bad cipher suites listed in RFC7540 for TLS handshake.Consumer
<? super SslContextBuilder> Returns theConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session.Returns theTlsEngineType
that will be used for processing TLS connections.boolean
Returns whether to use HTTP pipelining for HTTP/1 connections.boolean
Returns whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection.boolean
Returns whether to use HTTP/2 over TLS without ALPN.Returns the workerEventLoopGroup
.Methods inherited from class com.linecorp.armeria.common.util.AbstractOptions
asMap, get, iterator, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
WORKER_GROUP
The workerEventLoopGroup
. -
SHUTDOWN_WORKER_GROUP_ON_CLOSE
Whether to shut down the workerEventLoopGroup
when theClientFactory
is closed. -
EVENT_LOOP_SCHEDULER_FACTORY
public static final ClientFactoryOption<Function<? super EventLoopGroup,? extends EventLoopScheduler>> EVENT_LOOP_SCHEDULER_FACTORYThe factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
. -
TLS_CUSTOMIZER
TheConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session. -
TLS_ALLOW_UNSAFE_CIPHERS
Deprecated.It's not recommended to enable this option. Use it only when you have no other way to communicate with an insecure peer than this.Whether to allow the bad cipher suites listed in RFC7540 for TLS handshake.Note that enabling this option increases the security risk of your connection. Use it only when you must communicate with a legacy system that does not support secure cipher suites. See Section 9.2.2, RFC7540 for more information.
-
TLS_ENGINE_TYPE
TheTlsEngineType
that will be used for processing TLS connections. -
ADDRESS_RESOLVER_GROUP_FACTORY
public static final ClientFactoryOption<Function<? super EventLoopGroup,? extends AddressResolverGroup<? extends InetSocketAddress>>> ADDRESS_RESOLVER_GROUP_FACTORYThe factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es. -
HTTP2_INITIAL_CONNECTION_WINDOW_SIZE
The HTTP/2 initial connection flow-control window size. -
HTTP2_INITIAL_STREAM_WINDOW_SIZE
The SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control. -
HTTP2_MAX_FRAME_SIZE
The SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive. -
HTTP2_MAX_HEADER_LIST_SIZE
The HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets. -
HTTP1_MAX_INITIAL_LINE_LENGTH
The maximum length of an HTTP/1 response initial line. -
HTTP1_MAX_HEADER_SIZE
The maximum length of all headers in an HTTP/1 response. -
HTTP1_MAX_CHUNK_SIZE
The maximum length of each chunk in an HTTP/1 response content. -
IDLE_TIMEOUT_MILLIS
The idle timeout of a socket connection in milliseconds. -
KEEP_ALIVE_ON_PING
If the idle timeout is reset when an HTTP/2 PING frame or the response of"OPTIONS * HTTP/1.1"
is received. -
PING_INTERVAL_MILLIS
-
MAX_CONNECTION_AGE_MILLIS
The client-side max age of a connection for keep-alive in milliseconds. If the value is greater than0
, a connection is disconnected after the specified amount of time since the connection was established. This option is disabled by default, which means unlimited. -
CONNECTION_OUTLIER_DETECTION
TheOutlierDetection
which is used to detect unhealthy connections. If an unhealthy connection is detected, it is disabled and a new connection will be created. This option is disabled by default. -
MAX_NUM_REQUESTS_PER_CONNECTION
The client-side maximum allowed number of requests that can be sent through one connection. This option is disabled by default, which means unlimited. -
USE_HTTP2_PREFACE
Whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection.Note that this option is only effective when the
SessionProtocol
of theEndpoint
isSessionProtocol.HTTP
. If theSessionProtocol
isSessionProtocol.HTTPS
orSessionProtocol.H2
, ALPN will be used. If theSessionProtocol
isSessionProtocol.H2C
, the client will always use HTTP/2 connection preface. -
PREFER_HTTP1
Whether to use HTTP/1.1 instead of HTTP/2. If enabled, the client will not attempt to upgrade to HTTP/2 forSessionProtocol.HTTP
andSessionProtocol.HTTPS
. -
USE_HTTP2_WITHOUT_ALPN
Whether to use HTTP/2 without ALPN. This is useful if you want to communicate with an HTTP/2 server over TLS but the server does not support ALPN. -
USE_HTTP1_PIPELINING
Whether to use HTTP pipelining for HTTP/1 connections. -
CONNECTION_POOL_LISTENER
The listener which is notified on a connection pool event. -
HTTP2_GRACEFUL_SHUTDOWN_TIMEOUT_MILLIS
The graceful connection shutdown timeout in milliseconds.. -
METER_REGISTRY
TheMeterRegistry
which collects various stats. -
PROXY_CONFIG_SELECTOR
TheProxyConfigSelector
which determines theProxyConfig
to be used. -
HTTP1_HEADER_NAMING
TheHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another HTTP/1 header name. -
CHANNEL_OPTIONS
TheChannelOption
s of the sockets created by theClientFactory
. -
CHANNEL_PIPELINE_CUSTOMIZER
@UnstableApi public static final ClientFactoryOption<Consumer<? super ChannelPipeline>> CHANNEL_PIPELINE_CUSTOMIZERTheConsumer
that customizes the NettyChannelPipeline
. This customizer is run right beforeChannelOutboundInvoker.connect(SocketAddress)
is invoked by Armeria. This customizer is no-op by default.Note that usage of this customizer is an advanced feature and may produce unintended side effects, including complete breakdown. It is not recommended if you are not familiar with Armeria and Netty internals.
-
-
Method Details
-
of
Returns an empty singletonClientFactoryOptions
. -
of
Returns theClientFactoryOptions
with the specifiedClientFactoryOptionValue
s. -
of
Returns theClientFactoryOptions
with the specifiedClientFactoryOptionValue
s. -
of
public static ClientFactoryOptions of(ClientFactoryOptions baseOptions, ClientFactoryOptionValue<?>... additionalValues) Merges the specifiedClientFactoryOptions
andClientFactoryOptionValue
s.- Returns:
- the merged
ClientFactoryOptions
-
of
public static ClientFactoryOptions of(ClientFactoryOptions baseOptions, Iterable<? extends ClientFactoryOptionValue<?>> additionalValues) Merges the specifiedClientFactoryOptions
andClientFactoryOptionValue
s.- Returns:
- the merged
ClientFactoryOptions
-
workerGroup
Returns the workerEventLoopGroup
. -
shutdownWorkerGroupOnClose
public boolean shutdownWorkerGroupOnClose()Returns the flag whether to shut down the workerEventLoopGroup
when theClientFactory
is closed. -
eventLoopSchedulerFactory
Returns the factory that creates anEventLoopScheduler
which is responsible for assigning anEventLoop
to handle a connection to the specifiedEndpoint
. -
channelOptions
Returns theChannelOption
s of the sockets created by theClientFactory
. -
tlsCustomizer
Returns theConsumer
which can arbitrarily configure theSslContextBuilder
that will be applied to the SSL session. -
addressResolverGroupFactory
public Function<? super EventLoopGroup,? extends AddressResolverGroup<? extends InetSocketAddress>> addressResolverGroupFactory()Returns the factory that creates anAddressResolverGroup
which resolves remote addresses intoInetSocketAddress
es. -
http2InitialConnectionWindowSize
public int http2InitialConnectionWindowSize()Returns the HTTP/2 initial connection flow-control window size. -
http2InitialStreamWindowSize
public int http2InitialStreamWindowSize()Returns the SETTINGS_INITIAL_WINDOW_SIZE for HTTP/2 stream-level flow control. -
http2MaxFrameSize
public int http2MaxFrameSize()Returns the SETTINGS_MAX_FRAME_SIZE that indicates the size of the largest frame payload that this client is willing to receive. -
http2MaxHeaderListSize
public long http2MaxHeaderListSize()Returns the HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE that indicates the maximum size of header list that the client is prepared to accept, in octets. -
http1MaxInitialLineLength
public int http1MaxInitialLineLength()Returns the maximum length of an HTTP/1 response initial line. -
http1MaxHeaderSize
public int http1MaxHeaderSize()Returns the maximum length of all headers in an HTTP/1 response. -
http1MaxChunkSize
public int http1MaxChunkSize()Returns the maximum length of each chunk in an HTTP/1 response content. -
idleTimeoutMillis
public long idleTimeoutMillis()Returns the idle timeout of a socket connection in milliseconds. -
keepAliveOnPing
Returns whether to keep connection alive when an HTTP/2 PING frame or the response of"OPTIONS * HTTP/1.1"
is received. -
pingIntervalMillis
public long pingIntervalMillis() -
maxConnectionAgeMillis
public long maxConnectionAgeMillis()Returns the client-side max age of a connection for keep-alive in milliseconds. If the value is greater than0
, a connection is disconnected after the specified amount of the time since the connection was established. -
maxNumRequestsPerConnection
public int maxNumRequestsPerConnection()Returns the client-side maximum allowed number of requests that can be sent through one connection. -
useHttp2Preface
public boolean useHttp2Preface()Returns whether to send an HTTP/2 preface string instead of an HTTP/1 upgrade request to negotiate the protocol version of a cleartext HTTP connection.Note that this option is only effective when the
SessionProtocol
of theEndpoint
isSessionProtocol.HTTP
. If theSessionProtocol
isSessionProtocol.HTTPS
orSessionProtocol.H2
, ALPN will be used. If theSessionProtocol
isSessionProtocol.H2C
, the client will always use HTTP/2 connection preface. -
preferHttp1
Returns whether to use HTTP/1.1 instead of HTTP/2 . Iftrue
, the client will not attempt to upgrade to HTTP/2 forSessionProtocol.HTTP
andSessionProtocol.HTTPS
. -
useHttp2WithoutAlpn
Returns whether to use HTTP/2 over TLS without ALPN. -
useHttp1Pipelining
public boolean useHttp1Pipelining()Returns whether to use HTTP pipelining for HTTP/1 connections. -
connectionPoolListener
Returns the listener which is notified on a connection pool event. -
connectionOutlierDetection
Returns theOutlierDetection
which is used to detect unhealthy connections. -
http2GracefulShutdownTimeoutMillis
public long http2GracefulShutdownTimeoutMillis()Returns the graceful connection shutdown timeout in milliseconds. -
meterRegistry
Returns theMeterRegistry
which collects various stats. -
proxyConfigSelector
TheProxyConfigSelector
which determines theProxyConfig
to be used. -
http1HeaderNaming
Returns theHttp1HeaderNaming
which converts a lower-cased HTTP/2 header name into another header name. This is useful when communicating with a legacy system that only supports case-sensitive HTTP/1 headers. -
tlsAllowUnsafeCiphers
public boolean tlsAllowUnsafeCiphers()Returns whether to allow the bad cipher suites listed in RFC7540 for TLS handshake.Note that enabling this option increases the security risk of your connection. Use it only when you must communicate with a legacy system that does not support secure cipher suites. See Section 9.2.2, RFC7540 for more information.
-
tlsEngineType
Returns theTlsEngineType
that will be used for processing TLS connections. -
channelPipelineCustomizer
TheConsumer
that customizes the NettyChannelPipeline
. This customizer is run right beforeChannelOutboundInvoker.connect(SocketAddress)
is invoked by Armeria. This customizer is no-op by default.Note that usage of this customizer is an advanced feature and may produce unintended side effects, including complete breakdown. It is not recommended if you are not familiar with Armeria and Netty internals.
-