-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQS long polling throws exceptions on shutdown #909
Comments
Hi @zmaks, Since you're manually receiving messages using the How to do that really depends on how you structure your app - for example, you can collect the Makes sense? |
Hi @tomazfernandes, Thank you for the answer. On the other hand, the library provides an API: But I like your suggestion, I'll switch to async version of this method. Thanks! |
We could add a structure for that, but since we propagate the error up to the caller, I'm not sure what actual value this would bring to the user. If it's just about the logs, we might as well have a flag to disable it. Otherwise the behavior is pretty much the same as the AWS clients - if you use the blocking method and polling fails due to shutdown or anything else, it'll throw an exception just the same. If you have any ideas let me know. Thanks. |
Type: Bug
Component: SQS
Describe the bug
My app receives SQS messages via long polling using default
SqsTemplate
using thereceive()
method.The problem is that when I shut down the app, there are bunch of errors in the logs.
There 3 errors like this since it makes retries:
And one more at the end:
How to handle these shutdown-related errors properly?
Spring Boot version: 3.0.4
AWS Spring version: 3.0.2
Sample
Here is the code that does the polling:
The text was updated successfully, but these errors were encountered: