diff --git a/src/main/java/de/idealo/spring/stream/binder/sqs/health/SqsBinderHealthIndicator.java b/src/main/java/de/idealo/spring/stream/binder/sqs/health/SqsBinderHealthIndicator.java index f54d773..ccf5a9b 100644 --- a/src/main/java/de/idealo/spring/stream/binder/sqs/health/SqsBinderHealthIndicator.java +++ b/src/main/java/de/idealo/spring/stream/binder/sqs/health/SqsBinderHealthIndicator.java @@ -2,6 +2,7 @@ import java.net.URI; import java.net.URISyntaxException; +import java.util.concurrent.ExecutionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,9 +79,12 @@ private boolean isReachable(String queueName) { } catch (SdkClientException e) { LOGGER.error("Queue '{}' is not reachable", queueName, e); return false; - } catch (Exception e) { + } catch (ExecutionException e) { LOGGER.error("Health check failed for queue '{}'", queueName, e); return false; + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return false; } } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 0b5accb..de134d4 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -12,6 +12,7 @@ +