From 1fb69c15be83128910ee391b0c8862c97193181f Mon Sep 17 00:00:00 2001 From: Johan Haleby Date: Fri, 19 Jan 2024 07:32:33 +0100 Subject: [PATCH] Tweaked logging --- .../blocking/ccs/internal/MongoListenerLockService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/subscription/mongodb/common/blocking/competing-consumer-strategy/src/main/java/org/occurrent/subscription/mongodb/blocking/ccs/internal/MongoListenerLockService.java b/subscription/mongodb/common/blocking/competing-consumer-strategy/src/main/java/org/occurrent/subscription/mongodb/blocking/ccs/internal/MongoListenerLockService.java index 835c10ee9..bb25fbe5c 100644 --- a/subscription/mongodb/common/blocking/competing-consumer-strategy/src/main/java/org/occurrent/subscription/mongodb/blocking/ccs/internal/MongoListenerLockService.java +++ b/subscription/mongodb/common/blocking/competing-consumer-strategy/src/main/java/org/occurrent/subscription/mongodb/blocking/ccs/internal/MongoListenerLockService.java @@ -95,13 +95,14 @@ static Optional acquireOrRefreshFor(MongoCollection } catch (MongoCommandException e) { final ErrorCategory errorCategory = ErrorCategory.fromErrorCode(e.getErrorCode()); - logDebug("Caught {} - {} in acquireOrRefreshFor (errorCategory={}, subscriberId={}, subscriptionId={}, duplicate={})", - e.getClass().getName(), e.getMessage(), errorCategory, subscriberId, subscriptionId, errorCategory.equals(DUPLICATE_KEY)); - if (errorCategory.equals(DUPLICATE_KEY)) { + // This happens frequently, so we don't log it return Optional.empty(); } + logDebug("Caught {} - {} in acquireOrRefreshFor (errorCategory={}, subscriberId={}, subscriptionId={})", + e.getClass().getName(), e.getMessage(), errorCategory, subscriberId, subscriptionId); + throw e; } });