awspring / spring-cloud-aws

The New Home for Spring Cloud AWS
http://awspring.io
Apache License 2.0
882 stars 300 forks source link

SQS Listener not working with basic Spring Boot setup #1012

Closed arun1ram closed 9 months ago

arun1ram commented 10 months ago

Type: Bug

Component: SQS

Describe the bug Spring Boot Version: 3.2.0 Spring Cloud Version: 3.1.0 I created a very simple Spring Boot application as described in https://docs.awspring.io/spring-cloud-aws/docs/3.1.0/reference/html/index.html#sqs-integration Maven pom file Contents:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>sqsissuemaven</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>sqsissuemaven</name>
    <description>sqsissuemaven</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>2.21.42</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.awspring.cloud</groupId>
                <artifactId>spring-cloud-aws-dependencies</artifactId>
                <version>3.1.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>io.awspring.cloud</groupId>
            <artifactId>spring-cloud-aws-starter-sqs</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

The code is as follows:

package com.example.sqsissuemaven;

import io.awspring.cloud.sqs.annotation.SqsListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SqsIssueMavenApplication {

    public static void main(String[] args) {
        SpringApplication.run(SqsIssueMavenApplication.class, args);
    }
    @SqsListener("https://sqs.us-east-1.amazonaws.com/valid_account/valid_queue_name")
    public void listen(String message) {
        System.out.println(message);
    }
}

Sample

Running this application on a Mac M1 machine produces an error as below:

2024-01-05T18:00:33.666-05:00  INFO 14640 --- [           main] c.e.s.SqsIssueMavenApplication           : Starting SqsIssueMavenApplication v0.0.1-SNAPSHOT using Java 17.0.9 with PID 14640 (/Users/H462151/source/sqsissuemaven/target/sqsissuemaven-0.0.1-SNAPSHOT.jar started by H462151 in /Users/H462151/source/sqsissuemaven)
2024-01-05T18:00:33.667-05:00  INFO 14640 --- [           main] c.e.s.SqsIssueMavenApplication           : No active profile set, falling back to 1 default profile: "default"
2024-01-05T18:00:34.440-05:00  INFO 14640 --- [ecycle-thread-1] a.c.s.l.AbstractMessageListenerContainer : Container io.awspring.cloud.sqs.sqsListenerEndpointContainer#0 started
2024-01-05T18:00:34.476-05:00  INFO 14640 --- [           main] c.e.s.SqsIssueMavenApplication           : Started SqsIssueMavenApplication in 0.974 seconds (process running for 1.277)
2024-01-05T18:00:55.166-05:00 ERROR 14640 --- [nc-response-1-3] i.a.c.s.l.s.AbstractPollingMessageSource : Error polling for messages in queue https://sqs.us-east-1.amazonaws.com/valid_account/valid_queue_name

java.util.concurrent.CompletionException: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0xcd0de04a, L:/10.18.154.91:65237 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.006756S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000103875S)
        at software.amazon.awssdk.utils.CompletableFutureUtils.errorAsCompletionException(CompletableFutureUtils.java:65) ~[utils-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.lambda$execute$0(AsyncExecutionFailureExceptionReportingStage.java:51) ~[sdk-core-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[na:na]
        at software.amazon.awssdk.utils.CompletableFutureUtils.lambda$forwardExceptionTo$0(CompletableFutureUtils.java:79) ~[utils-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[na:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeAttemptExecute(AsyncRetryableStage.java:103) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeRetryExecute(AsyncRetryableStage.java:184) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.lambda$attemptExecute$1(AsyncRetryableStage.java:159) ~[sdk-core-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[na:na]
        at software.amazon.awssdk.utils.CompletableFutureUtils.lambda$forwardExceptionTo$0(CompletableFutureUtils.java:79) ~[utils-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[na:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.lambda$execute$0(MakeAsyncHttpRequestStage.java:108) ~[sdk-core-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2162) ~[na:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.completeResponseFuture(MakeAsyncHttpRequestStage.java:255) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.MakeAsyncHttpRequestStage.lambda$executeHttpRequest$3(MakeAsyncHttpRequestStage.java:167) ~[sdk-core-2.21.42.jar!/:na]
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
        at java.base/java.lang.Thread.run(Thread.java:840) ~[na:na]
Caused by: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0xcd0de04a, L:/10.18.154.91:65237 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.006756S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000103875S)
        at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:111) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.exception.SdkClientException.create(SdkClientException.java:47) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:223) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.utils.RetryableStageHelper.setLastException(RetryableStageHelper.java:218) ~[sdk-core-2.21.42.jar!/:na]
        at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncRetryableStage$RetryingExecutor.maybeRetryExecute(AsyncRetryableStage.java:182) ~[sdk-core-2.21.42.jar!/:na]
        ... 23 common frames omitted
        Suppressed: software.amazon.awssdk.core.exception.SdkClientException: Request attempt 1 failure: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0x92dde0d9, L:/10.18.154.91:50173 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.102488S, requestCount=1, responseCount=0, lastIdleDuration=PT0.004082792S)
        Suppressed: software.amazon.awssdk.core.exception.SdkClientException: Request attempt 2 failure: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0x53f58e48, L:/10.18.154.91:61644 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.007671S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000145625S)
        Suppressed: software.amazon.awssdk.core.exception.SdkClientException: Request attempt 3 failure: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0x17275ed9, L:/10.18.154.91:58649 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.011807S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000369458S)
Caused by: java.io.IOException: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0xcd0de04a, L:/10.18.154.91:65237 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.006756S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000103875S)
        at software.amazon.awssdk.http.nio.netty.internal.utils.NettyUtils.decorateException(NettyUtils.java:77) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor.handleFailure(NettyRequestExecutor.java:307) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.NettyRequestExecutor.lambda$writeRequest$13(NettyRequestExecutor.java:262) ~[netty-nio-client-2.21.42.jar!/:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.internal.PromiseNotificationUtil.tryFailure(PromiseNotificationUtil.java:64) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:57) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:31) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.safeSetFailure(AbstractChannel.java:999) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannel$AbstractUnsafe.write(AbstractChannel.java:860) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.write(DefaultChannelPipeline.java:1367) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:877) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.timeout.WriteTimeoutHandler.write(WriteTimeoutHandler.java:112) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler.wrap(SslHandler.java:892) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler.wrapAndFlush(SslHandler.java:822) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler.flush(SslHandler.java:803) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:925) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:907) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:893) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.flush(CombinedChannelDuplexHandler.java:531) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:125) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.CombinedChannelDuplexHandler.flush(CombinedChannelDuplexHandler.java:356) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:923) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:907) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:893) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.logging.LoggingHandler.flush(LoggingHandler.java:304) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:923) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:941) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler.completeBody(HttpStreamsHandler.java:340) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler.access$400(HttpStreamsHandler.java:46) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler$3$1.run(HttpStreamsHandler.java:318) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler.executeInEventLoop(HttpStreamsHandler.java:384) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler.access$300(HttpStreamsHandler.java:46) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HttpStreamsHandler$3.complete(HttpStreamsHandler.java:315) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriber$3.operationComplete(HandlerSubscriber.java:274) ~[netty-nio-client-2.21.42.jar!/:na]
        at software.amazon.awssdk.http.nio.netty.internal.nrs.HandlerSubscriber$3.operationComplete(HandlerSubscriber.java:271) ~[netty-nio-client-2.21.42.jar!/:na]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.internal.PromiseNotificationUtil.tryFailure(PromiseNotificationUtil.java:64) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:57) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:31) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.internal.PromiseNotificationUtil.tryFailure(PromiseNotificationUtil.java:64) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:57) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.DelegatingChannelPromiseNotifier.operationComplete(DelegatingChannelPromiseNotifier.java:31) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractCoalescingBufferQueue.releaseAndCompleteAll(AbstractCoalescingBufferQueue.java:360) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.AbstractCoalescingBufferQueue.releaseAndFailAll(AbstractCoalescingBufferQueue.java:218) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler.releaseAndFailAll(SslHandler.java:2011) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler.access$2300(SslHandler.java:171) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.handler.ssl.SslHandler$7.run(SslHandler.java:2224) ~[netty-handler-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.101.Final.jar!/:4.1.101.Final]
        ... 1 common frames omitted
Caused by: io.netty.channel.StacklessClosedChannelException: null
        at io.netty.channel.AbstractChannel$AbstractUnsafe.write(Object, ChannelPromise)(Unknown Source) ~[netty-transport-4.1.101.Final.jar!/:4.1.101.Final]
tomazfernandes commented 10 months ago

Hey @arun1ram.

The error message says SdkClientException: Unable to execute HTTP request: The connection was closed during the request. The request will usually succeed on a retry, but if it does not: consider disabling any proxies you have configured, enabling debug logging, or performing a TCP dump to identify the root cause. If this is a streaming operation, validate that data is being read or written in a timely manner. Channel Information: ChannelDiagnostics(channel=[id: 0xcd0de04a, L:/10.18.154.91:65237 ! R:sqs.us-east-1.amazonaws.com/3.236.169.67:443], channelAge=PT5.006756S, requestCount=1, responseCount=0, lastIdleDuration=PT0.000103875S)

Have your tried the suggested troubleshooting?

Another suspect would be if the application is shutting down unexpectedly due to some error on startup or similar.

arun1ram commented 9 months ago

Hi @tomazfernandes Thanks for your feedback. After much troubleshooting, I found that the root cause was the default connection timeout used by the Netty client used by AWS SDK. When I increased the connection timeout as below, it started working:

@Configuration
public class SqsConfig {
    @Bean
    public SqsAsyncClient sqsAsyncClient() {
        return SqsAsyncClient.builder().httpClientBuilder(NettyNioAsyncHttpClient.builder()
                .connectionTimeout(Duration.ofMinutes(5))).build();
    }
}

A note could be added to the "Getting Started" manual to ask the user to configure the defaults. Also, the current error message is very generic and I could not get any more information by enabling debug logs. The thing that helped me was the stack trace and being able to look at the open source code and see that there was a timeout issue going on.

tomazfernandes commented 9 months ago

Hi @arun1ram, unfortunately the log message you see is from AWS SDK, so you could ask them :)

I don't see anything the framework could do to help there, and this is related to AWS configuration and not the framework.

Since you solved the issue, I'll close this, but we can reopen if necessary.

Thanks.