awslabs / awslabs/amazon-sqs-java-temporary-queues-client

SQSMessageConsumer doesn't handle errors gracefully

Open
#26 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
99
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Hi

`SQSMessageConsumer` has a tight loop in `poll()`, summarised as:

```
for (;;) {
try {
// receive a message
} catch (Exception e) {
exceptionHandler.accept(e);
}
}
```
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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.