[ 
https://issues.apache.org/jira/browse/CAMEL-15457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17183119#comment-17183119
 ] 

Claus Ibsen commented on CAMEL-15457:
-------------------------------------

What version of Camel do you use?

> camel-micrometer: NullPointer exception triggered by 
> MicrometerExchangeEventNotifier
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-15457
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15457
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-micrometer
>            Reporter: Espen Andreassen
>            Priority: Major
>
> A recent [comit|[https://github.com/apache/camel/pull/3976]] causes 
> NullPointer exceptions in some circumstances, though they are caught and 
> logged as "WARN".
> Output from the test testCamelRouteEvents() in 
> MicrometerExchangeEventNotifierTest in master branch:
> {code:java}
> 11:44:32.741 [main] WARN org.apache.camel.support.EventHelper - Error 
> notifying event ID-devbox-1598261669122-0-1 exchange 
> Exchange[ID-devbox-1598261669122-0-1] sending to: direct://in. This exception 
> will be ignored.11:44:32.741 [main] WARN org.apache.camel.support.EventHelper 
> - Error notifying event ID-devbox-1598261669122-0-1 exchange 
> Exchange[ID-devbox-1598261669122-0-1] sending to: direct://in. This exception 
> will be ignored.java.lang.NullPointerException: null at 
> java.util.Objects.requireNonNull(Objects.java:221) ~[?:?] at 
> io.micrometer.core.instrument.ImmutableTag.<init>(ImmutableTag.java:35) 
> ~[micrometer-core-1.5.4.jar:1.5.4] at 
> io.micrometer.core.instrument.Tag.of(Tag.java:29) 
> ~[micrometer-core-1.5.4.jar:1.5.4] at 
> io.micrometer.core.instrument.Tags.of(Tags.java:254) 
> ~[micrometer-core-1.5.4.jar:1.5.4] at 
> org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifierNamingStrategy.getInflightExchangesTags(MicrometerExchangeEventNotifierNamingStrategy.java:58)
>  ~[classes/:?] at 
> org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.handleExchangeEvent(MicrometerExchangeEventNotifier.java:80)
>  ~[classes/:?] at 
> org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.notify(MicrometerExchangeEventNotifier.java:65)
>  ~[classes/:?] at 
> org.apache.camel.support.EventHelper.doNotifyEvent(EventHelper.java:1236) 
> ~[classes/:?] at 
> org.apache.camel.support.EventHelper.notifyExchangeSending(EventHelper.java:700)
>  ~[classes/:?]
> {code}
> The problem is that the MicrometerExchangeEventNotifier tries to build/update 
> a metric on inflight exchanges in a route based on an ExchangeEvent with no 
> associated fromRoute/fromRouteId. Events such as "ExchangeSendingEvent", as 
> is created in the test, is an example of such an ExchangeEvent.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to