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/01/30 12:24:07 UTC

[camel] branch camel-3.20.x updated: CAMEL-18954: camel-micrometer - Fix NPE

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

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


The following commit(s) were added to refs/heads/camel-3.20.x by this push:
     new afce10e310b CAMEL-18954: camel-micrometer - Fix NPE
afce10e310b is described below

commit afce10e310bf8528d9e0e8f7168cfbfb3bb7fbf2
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jan 30 13:22:33 2023 +0100

    CAMEL-18954: camel-micrometer - Fix NPE
---
 .../MicrometerExchangeEventNotifierNamingStrategy.java              | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerExchangeEventNotifierNamingStrategy.java b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerExchangeEventNotifierNamingStrategy.java
index 6e6f6640257..5092340669c 100644
--- a/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerExchangeEventNotifierNamingStrategy.java
+++ b/components/camel-micrometer/src/main/java/org/apache/camel/component/micrometer/eventnotifier/MicrometerExchangeEventNotifierNamingStrategy.java
@@ -46,11 +46,15 @@ public interface MicrometerExchangeEventNotifierNamingStrategy {
     }
 
     default Tags getTags(ExchangeEvent event, Endpoint endpoint) {
+        String uri = "";
+        if (endpoint != null) {
+            uri = endpoint.getEndpointUri();
+        }
         return Tags.of(
                 CAMEL_CONTEXT_TAG, event.getExchange().getContext().getName(),
                 SERVICE_NAME, MicrometerEventNotifierService.class.getSimpleName(),
                 EVENT_TYPE_TAG, event.getClass().getSimpleName(),
-                ENDPOINT_NAME, endpoint.getEndpointUri(),
+                ENDPOINT_NAME, uri,
                 FAILED_TAG, Boolean.toString(event.getExchange().isFailed()));
     }