use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientIdleConnectionTtl.
@Test
public void testCreateNettyAsyncHttpClientIdleConnectionTtl() throws Exception {
Duration connectionTtl = Duration.ofMillis(5000);
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.CONNECTION_TIME_TO_LIVE, connectionTtl).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(connectionTtl.toMillis(), nettyConfiguration.connectionTtlMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsReadTimeout.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsReadTimeout() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(360_000, nettyConfiguration.readTimeoutMillis());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsMaxPendingConnectionAcquires.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsMaxPendingConnectionAcquires() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
SdkAsyncHttpClient httpDefaultClient = NettyNioAsyncHttpClient.create();
NettyConfiguration nettyDefaultConfiguration = TestUtil.getNettyConfiguration(httpDefaultClient);
assertEquals(nettyDefaultConfiguration.maxPendingConnectionAcquires(), nettyConfiguration.maxPendingConnectionAcquires());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsMaxConnections.
@Test
public void testCreateNettyAsyncHttpClientWithDefaultsMaxConnections() throws Exception {
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(10_000, nettyConfiguration.maxConnections());
}
use of software.amazon.awssdk.http.async.SdkAsyncHttpClient in project flink by apache.
the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientTrustAllCertificates.
@Test
public void testCreateNettyAsyncHttpClientTrustAllCertificates() throws Exception {
boolean trustAllCertificates = true;
AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.TRUST_ALL_CERTIFICATES, trustAllCertificates).build();
NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
assertEquals(trustAllCertificates, nettyConfiguration.trustAllCertificates());
}
Aggregations