You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/12/11 08:52:14 UTC

(camel) branch camel-4.0.x updated: CAMEL-19734: fixing the elapsed time to message history (#12388)

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

davsclaus pushed a commit to branch camel-4.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.0.x by this push:
     new 9f28788ee13 CAMEL-19734: fixing the elapsed time to message history  (#12388)
9f28788ee13 is described below

commit 9f28788ee13eb9f73c72268640bf78657b9054f2
Author: Rhuan Rocha <rh...@gmail.com>
AuthorDate: Mon Dec 11 05:51:46 2023 -0300

    CAMEL-19734: fixing the elapsed time to message history  (#12388)
    
    * CAMEL-19734: fixing the elapsed time to message history
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
    
    * CAMEL-19734: fixing the elapsed time to message history
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
    
    ---------
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
---
 .../src/main/java/org/apache/camel/support/MessageHelper.java          | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
index e145a2947e6..fe768d6548e 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/MessageHelper.java
@@ -40,7 +40,6 @@ import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.camel.trait.message.MessageTrait;
 import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.StopWatch;
 import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.json.JsonArray;
@@ -707,7 +706,7 @@ public final class MessageHelper {
             label = "from[" + URISupport.sanitizeUri(StringHelper.limitLength(exchange.getFromEndpoint().getEndpointUri(), 100))
                     + "]";
         }
-        long elapsed = new StopWatch(exchange.getCreated()).taken();
+        long elapsed = System.currentTimeMillis() - exchange.getCreated();
 
         List<MessageHistory> list = exchange.getProperty(ExchangePropertyKey.MESSAGE_HISTORY, List.class);
         boolean enabled = list != null;