public static interface NettyNioAsyncHttpClient.Builder extends SdkAsyncHttpClient.Builder<NettyNioAsyncHttpClient.Builder>
NettyNioAsyncHttpClient.builder()
to configure and construct
a Netty HTTP client.Modifier and Type | Method and Description |
---|---|
NettyNioAsyncHttpClient.Builder |
connectionAcquisitionTimeout(Duration connectionAcquisitionTimeout)
The amount of time to wait when acquiring a connection from the pool before giving up and timing out.
|
NettyNioAsyncHttpClient.Builder |
connectionTimeout(Duration timeout)
The amount of time to wait when initially establishing a connection before giving up and timing out.
|
NettyNioAsyncHttpClient.Builder |
eventLoopGroup(SdkEventLoopGroup eventLoopGroup)
Sets the
SdkEventLoopGroup to use for the Netty HTTP client. |
NettyNioAsyncHttpClient.Builder |
eventLoopGroupBuilder(SdkEventLoopGroup.Builder eventLoopGroupBuilder)
Sets the
SdkEventLoopGroup.Builder which will be used to create the SdkEventLoopGroup for the Netty
HTTP client. |
NettyNioAsyncHttpClient.Builder |
maxConcurrency(Integer maxConcurrency)
Maximum number of allowed concurrent requests.
|
NettyNioAsyncHttpClient.Builder |
maxPendingConnectionAcquires(Integer maxPendingAcquires)
The maximum number of pending acquires allowed.
|
NettyNioAsyncHttpClient.Builder |
protocol(Protocol protocol)
Sets the HTTP protocol to use (i.e.
|
NettyNioAsyncHttpClient.Builder |
readTimeout(Duration readTimeout)
The amount of time to wait for a read on a socket before an exception is thrown.
|
NettyNioAsyncHttpClient.Builder |
writeTimeout(Duration writeTimeout)
The amount of time to wait for a write on a socket before an exception is thrown.
|
build, buildWithDefaults
applyMutation
NettyNioAsyncHttpClient.Builder maxConcurrency(Integer maxConcurrency)
If the maximum number of concurrent requests is exceeded they may be queued in the HTTP client (see
maxPendingConnectionAcquires(Integer)
connectionAcquisitionTimeout(Duration)
).
maxConcurrency
- New value for max concurrency.NettyNioAsyncHttpClient.Builder maxPendingConnectionAcquires(Integer maxPendingAcquires)
maxPendingAcquires
- Max number of pending acquiresNettyNioAsyncHttpClient.Builder readTimeout(Duration readTimeout)
readTimeout
- timeout durationNettyNioAsyncHttpClient.Builder writeTimeout(Duration writeTimeout)
writeTimeout
- timeout durationNettyNioAsyncHttpClient.Builder connectionTimeout(Duration timeout)
timeout
- the timeout durationNettyNioAsyncHttpClient.Builder connectionAcquisitionTimeout(Duration connectionAcquisitionTimeout)
connectionAcquisitionTimeout
- the timeout durationNettyNioAsyncHttpClient.Builder eventLoopGroup(SdkEventLoopGroup eventLoopGroup)
SdkEventLoopGroup
to use for the Netty HTTP client. This event loop group may be shared
across multiple HTTP clients for better resource and thread utilization. The preferred way to create
an EventLoopGroup
is by using the SdkEventLoopGroup.builder()
)} method which will choose the
optimal implementation per the platform.
The EventLoopGroup
MUST be closed by the caller when it is ready to
be disposed. The SDK will not close the EventLoopGroup
when the HTTP client is closed. See
EventExecutorGroup.shutdownGracefully()
to properly close the event loop group.
This configuration method is only recommended when you wish to share an EventLoopGroup
with multiple clients. If you do not need to share the group it is recommended to use
eventLoopGroupBuilder(SdkEventLoopGroup.Builder)
as the SDK will handle its cleanup when
the HTTP client is closed.
eventLoopGroup
- Netty SdkEventLoopGroup
to use.SdkEventLoopGroup
NettyNioAsyncHttpClient.Builder eventLoopGroupBuilder(SdkEventLoopGroup.Builder eventLoopGroupBuilder)
SdkEventLoopGroup.Builder
which will be used to create the SdkEventLoopGroup
for the Netty
HTTP client. This allows for custom configuration of the Netty EventLoopGroup
.
The EventLoopGroup
created by the builder is managed by the SDK and will be shutdown
when the HTTP client is closed.
This is the preferred configuration method when you just want to customize the EventLoopGroup
but not share it across multiple HTTP clients. If you do wish to share an EventLoopGroup
, see
eventLoopGroup(SdkEventLoopGroup)
eventLoopGroupBuilder
- SdkEventLoopGroup.Builder
to use.SdkEventLoopGroup.Builder
NettyNioAsyncHttpClient.Builder protocol(Protocol protocol)
protocol
- Protocol to use.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.