Search in sources :

Example 31 with NettyConfiguration

use of software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration in project flink by apache.

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsWriteTimeout.

@Test
public void testCreateNettyAsyncHttpClientWithDefaultsWriteTimeout() 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.writeTimeoutMillis(), nettyConfiguration.writeTimeoutMillis());
}
Also used : NettyNioAsyncHttpClient(software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient) NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Test(org.junit.Test)

Example 32 with NettyConfiguration

use of software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration in project flink by apache.

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientMaxConcurrency.

@Test
public void testCreateNettyAsyncHttpClientMaxConcurrency() throws Exception {
    int maxConnections = 123;
    AttributeMap clientConfiguration = AttributeMap.builder().put(SdkHttpConfigurationOption.MAX_CONNECTIONS, maxConnections).build();
    NettyNioAsyncHttpClient.Builder builder = NettyNioAsyncHttpClient.builder();
    SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(clientConfiguration, builder);
    NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
    assertEquals(maxConnections, nettyConfiguration.maxConnections());
}
Also used : AttributeMap(software.amazon.awssdk.utils.AttributeMap) NettyNioAsyncHttpClient(software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient) NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)32 NettyConfiguration (software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration)32 SdkAsyncHttpClient (software.amazon.awssdk.http.async.SdkAsyncHttpClient)29 NettyNioAsyncHttpClient (software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient)24 AttributeMap (software.amazon.awssdk.utils.AttributeMap)10 Properties (java.util.Properties)8 Duration (java.time.Duration)5 Protocol (software.amazon.awssdk.http.Protocol)2