-
Notifications
You must be signed in to change notification settings - Fork 372
Prevent spring-cloud-aws-messaging from trying to stop the queue #504
Comments
Actually, it's not about queues. I agree, it's not clear from their names, but methods like notifyRunningQueuesToStop, waitForRunningQueuesToStop or stopQueue are working with message listeners. When we have the
For testing scenario / faster shutdown we can reduce timeout for poll requests @Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory(
AmazonSQSAsync amazonSQSAsync
) {
SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();
factory.setAmazonSqs(amazonSQSAsync);
factory.setWaitTimeOut(1); // less than 10 sec
return factory;
} |
Would it be possible to set the timeout for the shutdown of the thread pool to the same value as the timeout for the long poll by default? I guess the default timeout of 20s for the long poll is something that is defined by the aws client. But if the developer provides a value for the long poll timeout to Spring, Spring could also apply it to the timeout for the shutdown of the threadpool. |
|
@maciejwalkowiak But we need |
I need some time to dig through SQS related issues. You are welcome to contribute PR but I'm not able at this point to guide you. |
@huehnerlady @maciejwalkowiak any progress? Happy to create a PR that exposes the |
@maciejwalkowiak thank you so much for implementing this. Do you have any idea when it will be released? :) |
Kudos go to @mkatircioglu! I am sorry but I can't tell exactly when 2.3 will be released as it's going to be first release after Spring Cloud AWS leaves Spring Cloud release train. |
* Allow queueStopTimeout can be configurable via SimpleMessageListenerContainerFactory * Increase queueStopTimeout default value in milliseconds to be equal to waitTimeOut Fixes spring-atticgh-504 Fixes spring-atticgh-507 Closes spring-atticgh-620
* Allow queueStopTimeout can be configurable via SimpleMessageListenerContainerFactory * Increase queueStopTimeout default value in milliseconds to be equal to waitTimeOut Fixes spring-attic#504 Fixes spring-attic#507 Closes spring-attic#620
@maciejwalkowiak do you have an update for this? any timeline when 2.3 will be released? or could it maybe be relesed in an earlier version after all? |
* Allow queueStopTimeout can be configurable via SimpleMessageListenerContainerFactory * Increase queueStopTimeout default value in milliseconds to be equal to waitTimeOut Fixes spring-attic/spring-cloud-aws#504 Fixes spring-attic/spring-cloud-aws#507 Closes spring-attic/spring-cloud-aws#620
I'm using spring-cloud-aws-messaging in a Spring Boot 2.1.9.RELEASE project.
I have SQS queue created manually in AWS.
It is being used like:
It works fine. But when I stop my application in IDE, or when the Spring Boot tests finish, it tries to stop the queue. It can't stop it and eventually times out. It throws this exception:
This waiting slows down application or tests shutdown.
How do I tell spring-cloud-aws-messaging that it is a manually created queue and it should not try to shut it down?
Not getting an answer on stackoverflow.
The text was updated successfully, but these errors were encountered: