awspring / spring-cloud-aws

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

Error in all SQS Queue even if just one queue is not present #1060

Open andersonfaria-hotmart opened 4 months ago

andersonfaria-hotmart commented 4 months ago

Type: Bug

Component: SQS

Describe the bug When using many SQS queues, and one of them does not exist, spring shows an error in all queues. And the error is not explicit about the problem.

logger -> io.awspring.cloud.sqs.listener.source.AbstractPollingMessageSource message -> Error polling for messages in queue product_sent_review Exception ->

java.util.concurrent.CompletionException: software.amazon.awssdk.core.exception.SdkClientException: Unable to execute HTTP request: event executor terminated
    at software.amazon.awssdk.utils.CompletableFutureUtils.errorAsCompletionException(CompletableFutureUtils.java:65)
    at software.amazon.awssdk.core.internal.http.pipeline.stages.AsyncExecutionFailureExceptionReportingStage.lambda$execute$0(AsyncExecutionFailureExceptionReportingStage.java:51)
    at java.base/java.util.concurrent.CompletableFuture.uniHandle(Unknown Source)
    at java.base/java.util.concurrent.CompletableFuture.uniHandleStage(Unknown Source)
    at java.base/java.util.concurrent.CompletableFuture.handle(Unknown Source)

product_sent_review exists and works properly, but the application expects a queue "producer_to_exclude" that doesn't exists

Sample Configure 3 sqs queues and 1 of them does not exists. The error will appear.

tomazfernandes commented 4 months ago

If a queue doesn't exist and cannot be created, the app won't start, which seems the correct behavior since it won't be able to comply with what it's been configured to do.

Can you share your reasoning for wanting the app to start even though it's configured to listen for a queue that doesn't exist?

andersonfaria-hotmart commented 4 months ago

My point is not to start the app, is about the logs. The logs show errors in all queues and not only in the queue that doesn't exist which makes it difficult to understand what is happening. The spring should show an error only in the queue with some problem.

tomazfernandes commented 4 months ago

Oh, I see.

The problem there is that the AWS SDK Task Executor is being shut down before the container has the chance to stop polling, so not sure if we can really do something about it.

Can you check the logs to see if the original error QueueDoesNotExistException or Error creating queue appears somewhere?

Thanks.