Search in sources :

Example 16 with NettyConfiguration

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

the class KinesisProxyV2FactoryTest method testReadTimeoutPopulatedFromProperties.

@Test
public void testReadTimeoutPopulatedFromProperties() throws Exception {
    Properties properties = properties();
    properties.setProperty(EFO_HTTP_CLIENT_READ_TIMEOUT_MILLIS, "12345");
    KinesisProxyV2Interface proxy = KinesisProxyV2Factory.createKinesisProxyV2(properties);
    NettyConfiguration nettyConfiguration = getNettyConfiguration(proxy);
    assertEquals(12345, nettyConfiguration.readTimeoutMillis());
}
Also used : NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) Properties(java.util.Properties) Test(org.junit.Test)

Example 17 with NettyConfiguration

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

the class KinesisProxyV2FactoryTest method testClientConfigurationPopulatedTcpKeepAliveDefaults.

@Test
public void testClientConfigurationPopulatedTcpKeepAliveDefaults() throws Exception {
    Properties properties = properties();
    KinesisProxyV2Interface proxy = KinesisProxyV2Factory.createKinesisProxyV2(properties);
    NettyConfiguration nettyConfiguration = getNettyConfiguration(proxy);
    Assert.assertTrue(nettyConfiguration.tcpKeepAlive());
}
Also used : NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) Properties(java.util.Properties) Test(org.junit.Test)

Example 18 with NettyConfiguration

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

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsTcpKeepAlive.

@Test
public void testCreateNettyAsyncHttpClientWithDefaultsTcpKeepAlive() 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.tcpKeepAlive(), nettyConfiguration.tcpKeepAlive());
}
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 19 with NettyConfiguration

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

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithDefaultsReapIdleConnections.

@Test
public void testCreateNettyAsyncHttpClientWithDefaultsReapIdleConnections() 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.reapIdleConnections(), nettyConfiguration.reapIdleConnections());
}
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 20 with NettyConfiguration

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

the class AWSGeneralUtilTest method testCreateNettyAsyncHttpClientWithPropertyProtocol.

@Test
public void testCreateNettyAsyncHttpClientWithPropertyProtocol() throws Exception {
    Protocol httpVersion = HTTP1_1;
    Properties properties = new Properties();
    properties.setProperty(AWSConfigConstants.HTTP_PROTOCOL_VERSION, String.valueOf(httpVersion));
    SdkAsyncHttpClient httpClient = AWSGeneralUtil.createAsyncHttpClient(properties);
    NettyConfiguration nettyConfiguration = TestUtil.getNettyConfiguration(httpClient);
    assertEquals(httpVersion, nettyConfiguration.attribute(SdkHttpConfigurationOption.PROTOCOL));
}
Also used : NettyConfiguration(software.amazon.awssdk.http.nio.netty.internal.NettyConfiguration) SdkAsyncHttpClient(software.amazon.awssdk.http.async.SdkAsyncHttpClient) Protocol(software.amazon.awssdk.http.Protocol) Properties(java.util.Properties) 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