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 2015/12/05 15:55:22 UTC

camel git commit: CAMEL-9389: camel-metrics - Allow to capture message history easily

Repository: camel
Updated Branches:
  refs/heads/master 28831913f -> 93d21ff8f


CAMEL-9389: camel-metrics - Allow to capture message history easily


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/93d21ff8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/93d21ff8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/93d21ff8

Branch: refs/heads/master
Commit: 93d21ff8f8347351c38eac1dc91f1e3f50de3eb3
Parents: 2883191
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Dec 5 15:54:03 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Dec 5 15:54:03 2015 +0100

----------------------------------------------------------------------
 .../metrics/messagehistory/MetricsMessageHistoryFactory.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/93d21ff8/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryFactory.java
----------------------------------------------------------------------
diff --git a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryFactory.java b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryFactory.java
index 56f9d60..274ab14 100644
--- a/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryFactory.java
+++ b/components/camel-metrics/src/main/java/org/apache/camel/component/metrics/messagehistory/MetricsMessageHistoryFactory.java
@@ -157,6 +157,13 @@ public class MetricsMessageHistoryFactory extends ServiceSupport implements Came
         } catch (Exception e) {
             throw ObjectHelper.wrapRuntimeCamelException(e);
         }
+
+        // use metrics registry from service if not explicit configured
+        if (metricsRegistry == null) {
+            metricsRegistry = messageHistoryService.getMetricsRegistry();
+        }
+
+        ObjectHelper.notNull(metricsRegistry, "metricsRegistry", this);
     }
 
     @Override