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 2019/05/28 13:06:40 UTC

[camel] 01/02: Update DefaultInflightRepository.java

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

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

commit 1cf1eb1fe6c9449389fd3125931da334f62aff46
Author: bdevido <47...@users.noreply.github.com>
AuthorDate: Tue May 28 14:27:17 2019 +0200

    Update DefaultInflightRepository.java
    
    CAMEL-13587: Inflight repository browse should compute elapsed if the message is still inflight at a given node. Thanks to Barbara De Vido for reporting.
---
 .../main/java/org/apache/camel/impl/DefaultInflightRepository.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
index 7f079ac..9052e65 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
@@ -223,7 +223,12 @@ public class DefaultInflightRepository extends ServiceSupport implements Infligh
             // get latest entry
             MessageHistory history = list.getLast();
             if (history != null) {
-                return history.getElapsed();
+                long elapsed = history.getElapsed();
+                if (elapsed == 0 && history.getTime() > 0) {
+                    // still in progress, so lets compute it via the start time
+                    elapsed = System.currentTimeMillis() - history.getTime();
+                }
+                return elapsed;
             } else {
                 return 0;
             }