This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-2.24.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 7bb8e2701b39afc9a2bbd55ace58450e5b600acb Author: bdevido <47347518+bdev...@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; }