From 2df3406c880ea9bdb678fec8c7e443c7c05822d0 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 11 Dec 2013 20:12:08 +0200 Subject: [PATCH] INT-3232: RedisQMDE: Polish Log Exceptions JIRA: https://jira.springsource.org/browse/INT-3232 Previously, in the `RedisQueueMessageDrivenEndpoint` all `Exceptions` on `rightPop` operation were logged with `error` level independently of the state of the Endpoint. Add `if...else` and log with `debug`, if the Endpoint isn't active and don't publish the event. --- .../inbound/RedisQueueMessageDrivenEndpoint.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java index 8435439974..1d7b3a7ee8 100644 --- a/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java +++ b/spring-integration-redis/src/main/java/org/springframework/integration/redis/inbound/RedisQueueMessageDrivenEndpoint.java @@ -178,10 +178,15 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl value = this.boundListOperations.rightPop(this.receiveTimeout, TimeUnit.MILLISECONDS); } catch (Exception e) { - logger.error("Failed to execute listening task. Will attempt to resubmit in " + this.recoveryInterval + " milliseconds.", e); this.listening = false; - this.sleepBeforeRecoveryAttempt(); - this.publishException(e); + if (this.active) { + logger.error("Failed to execute listening task. Will attempt to resubmit in " + this.recoveryInterval + " milliseconds.", e); + this.publishException(e); + this.sleepBeforeRecoveryAttempt(); + } + else { + logger.debug("Failed to execute listening task. " + e.getClass() + ": " + e.getMessage()); + } return; }