AWS SDK for Java
Developer Guide

HTTP Transport Configuration

You can use the NettyNioAsyncHttpClient for asynchronous clients or the ApacheHttpClient for synchronous clients to set HTTP transport settings. For a full list of options you can set with these clients, see the AWS SDK for Java 2.x Reference.

Add a dependency on the netty-nio-client in your POM to use the NettyNioAsyncHttpClient.

POM Entry

<dependencies> <dependency> <groupId></groupId> <artifactId>kinesis</artifactId>

Maximum Connections

You can set the maximum allowed number of open HTTP connections by using the maxConcurrency method. The maxPendingConnectionAcquires method enables you to set the maximum requests allowed to queue up once max concurrency is reached.

  • Default for maxConcurrency: 50

  • Default for maxPendingConnectionAcquires: 10_000


Set the maximum connections to the number of concurrent transactions to avoid connection contentions and poor performance.

Use the HTTP client builder to have the SDK manage its lifecycle. The HTTP client will be closed for you when the service client is shut down.


import; import; import;


KinesisAsyncClient client = KinesisAsyncClient.builder() .httpClientBuilder(NettyNioAsyncHttpClient.builder() .maxConcurrency(100) .maxPendingConnectionAcquires(10_000)) .build();

You can also pass the HTTP client directly to the service client if you want to manage the lifecycle yourself.


SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder() .maxConcurrency(100) .maxPendingConnectionAcquires(10_000) .build(); KinesisAsyncClient kinesisClient = KinesisAsyncClient.builder() .httpClient(httpClient) .build(); httpClient.close();

On this page: