@@ -0,0 +1,2871 @@
+//snippet-sourcedescription:%5BClientConfiguration.java demonstrates how to configure an HTTP client in the Kinesis asynchronous client.%5D%0A//snippet-keyword:%5BSDK for Java 2.0%5D%0A//snippet-keyword:%5BCode Sample%5D%0A//snippet-service:%5Bkinesis%5D%0A//snippet-sourcetype:%5Bfull-example%5D%0A//snippet-sourcedate:%5B4/9/2020%5D%0A//snippet-sourceauthor:%5Bsoo-aws%5D%0A/*%0A * Copyright 2011-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at:%0A *%0A *    http://aws.amazon.com/apache2.0%0A *%0A * This file is distributed on an %22AS IS%22 BASIS, WITHOUT WARRANTIES%0A * OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.example.kinesis;%0A// snippet-start:%5Bkinesis.java2.client_configuration.complete%5D%0A// snippet-start:%5Bkinesis.java2.client_configuration.import%5D%0A%0Aimport software.amazon.awssdk.http.async.SdkAsyncHttpClient;%0Aimport software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient;%0Aimport software.amazon.awssdk.services.kinesis.KinesisAsyncClient;%0A// snippet-end:%5Bkinesis.java2.client_configuration.import%5D%0A%0A// snippet-start:%5Bkinesis.java2.client_configuration.main%5D%0Apublic class ClientConfiguration %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// If configured with an httpClientBuilder, the SDK will manage the lifecycle of the HTTP client%0A        // and it will be shutdown when the client is shut down.%0A%09// snippet-start:%5Bkinesis.java2.client_configuration.client%5D%0A        KinesisAsyncClient client = KinesisAsyncClient.builder()%0A                          .httpClientBuilder(NettyNioAsyncHttpClient.builder()%0A                                                                    .maxConcurrency(100)%0A                                                                    .maxPendingConnectionAcquires(10_000))%0A                          .build();%0A%0A        // snippet-end:%5Bkinesis.java2.client_configuration.client%5D%0A%09// When passing in the httpClient directly, the lifecycle must be managed by the caller and the HTTP client%0A        // will not be shut down when the client is shut down.%0A%09// snippet-start:%5Bkinesis.java2.client_configuration.httpclient%5D%0A        SdkAsyncHttpClient httpClient = NettyNioAsyncHttpClient.builder()%0A                .maxConcurrency(100)%0A                .maxPendingConnectionAcquires(10_000)%0A                .build();%0A%0A        KinesisAsyncClient kinesisClient = KinesisAsyncClient.builder()%0A        %09%09.httpClient(httpClient)%0A        %09%09.build();%0A%0A        httpClient.close();%0A%09// snippet-end:%5Bkinesis.java2.client_configuration.httpclient%5D%0A%09%7D%0A%0A%7D%0A %0A// snippet-end:%5Bkinesis.java2.client_configuration.main%5D%0A// snippet-end:%5Bkinesis.java2.client_configuration.complete%5D%0A

Create ClientConfiguration.java