You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/02/28 07:58:46 UTC

[camel] 01/02: CAMEL-19060: avoid a potentially costly call to AtomicInteger.get() when notifying that the exchange had been created

This is an automated email from the ASF dual-hosted git repository.

orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 94322d2c2b99ab2b98d1fc9474bdb0c31eace1e7
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Wed Feb 22 15:57:09 2023 +0100

    CAMEL-19060: avoid a potentially costly call to AtomicInteger.get() when notifying that the exchange had been created
---
 .../main/java/org/apache/camel/main/MainDurationEventNotifier.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java b/core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java
index 9dd78738ad0..2e6ae1df989 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainDurationEventNotifier.java
@@ -102,7 +102,9 @@ public class MainDurationEventNotifier extends EventNotifierSupport {
 
         if (maxMessages > 0 && complete) {
             boolean result = doneMessages.incrementAndGet() >= maxMessages;
-            LOG.trace("Duration max messages check {} >= {} -> {}", doneMessages.get(), maxMessages, result);
+            if (LOG.isTraceEnabled()) {
+                LOG.trace("Duration max messages check {} >= {} -> {}", doneMessages.get(), maxMessages, result);
+            }
 
             if (result && shutdownStrategy.isRunAllowed()) {
                 if ("shutdown".equalsIgnoreCase(action)) {