Updating to new version of AWS SDK 2.10.56, changing Netty client defaults. (#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.
This commit is contained in:
parent
1a2932cc5a
commit
66f5204d84
3 changed files with 13 additions and 3 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
@ -35,6 +42,9 @@ public class KinesisClientUtil {
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import software.amazon.kinesis.retrieval.RecordsPublisher;
|
|||
@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;
|
||||
|
|
|
|||
2
pom.xml
2
pom.xml
|
|
@ -33,7 +33,7 @@
|
|||
</scm>
|
||||
|
||||
<properties>
|
||||
<awssdk.version>2.10.25</awssdk.version>
|
||||
<awssdk.version>2.10.56</awssdk.version>
|
||||
</properties>
|
||||
|
||||
<licenses>
|
||||
|
|
|
|||
Loading…
Reference in a new issue