-
Notifications
You must be signed in to change notification settings - Fork 28
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
SQSMessageConsumer doesn't handle errors gracefully #26
Comments
I see that I can override the default exception handler via |
Definitely not a bad idea to handle this better. There's already a sleep in place for That's a little more straight-forward, though, since that exception means it's very unlikely that immediately retrying will succeed. I wouldn't want to assume that about all exceptions, so I'm nervous about introducing an unconditional sleep. Perhaps we could hook up a configurable RetryPolicy? https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/retry/RetryPolicy.html |
Whatever the mechanism, I think the most important is that the error handling is in the library user's control, which it is for consumers, but not for requesters. If I can override the default, I guess it wouldn't matter to me what the default behaviour was. (But yes, a RetryPolicy does look like a nice way to go.) |
Hi, anyone fixing this ? |
Hi
SQSMessageConsumer
has a tight loop inpoll()
, summarised as:When an exception occurs (for example, kill network connectivity for a
java.net.UnknownHostException: sqs.eu-west-1.amazonaws.com
), this spins away and generates a huge stack trace every few milliseconds, and consumes all CPU resources very quickly.Please consider sleeping a second upon exception.
Thanks
The text was updated successfully, but these errors were encountered: