Skip to content

Commit

Permalink
Updating to new version of AWS SDK 2.10.56, changing Netty client def…
Browse files Browse the repository at this point in the history
…aults. (#679)

* Updating AWS SDK version to 2.10.56

* Changing default netty client to use 60 second ping health check timeout and 10MB initial window size.

* Tuning default request response timeout to 60 seconds.
  • Loading branch information
joshua-kim authored Jan 28, 2020
1 parent 1a2932c commit 66f5204
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,22 @@

package software.amazon.kinesis.common;

import software.amazon.awssdk.http.Protocol;
import software.amazon.awssdk.http.nio.netty.Http2Configuration;
import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient;
import software.amazon.awssdk.services.kinesis.KinesisAsyncClient;
import software.amazon.awssdk.services.kinesis.KinesisAsyncClientBuilder;

import java.time.Duration;

/**
* Utility to setup KinesisAsyncClient to be used with KCL.
*/
public class KinesisClientUtil {

private static int INITIAL_WINDOW_SIZE_BYTES = 10 * 1024 * 1024;
private static long HEALTH_CHECK_PING_PERIOD_MILLIS = 60 * 1000;

/**
* Creates a client from a builder.
*
Expand All @@ -35,6 +42,9 @@ public static KinesisAsyncClient createKinesisAsyncClient(KinesisAsyncClientBuil
}

public static KinesisAsyncClientBuilder adjustKinesisClientBuilder(KinesisAsyncClientBuilder builder) {
return builder.httpClientBuilder(NettyNioAsyncHttpClient.builder().maxConcurrency(Integer.MAX_VALUE));
return builder.httpClientBuilder(NettyNioAsyncHttpClient.builder().maxConcurrency(Integer.MAX_VALUE)
.http2Configuration(Http2Configuration.builder().initialWindowSize(INITIAL_WINDOW_SIZE_BYTES)
.healthCheckPingPeriod(Duration.ofMillis(HEALTH_CHECK_PING_PERIOD_MILLIS)).build())
.protocol(Protocol.HTTP2));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
@KinesisClientInternalApi
public class ShardConsumer {

public static final int MAX_TIME_BETWEEN_REQUEST_RESPONSE = 35000;
public static final int MAX_TIME_BETWEEN_REQUEST_RESPONSE = 60 * 1000;
private final RecordsPublisher recordsPublisher;
private final ExecutorService executorService;
private final ShardInfo shardInfo;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</scm>

<properties>
<awssdk.version>2.10.25</awssdk.version>
<awssdk.version>2.10.56</awssdk.version>
</properties>

<licenses>
Expand Down

0 comments on commit 66f5204

Please sign in to comment.