Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18954

camel-micrometer - NPE on spring boot

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      Hello everyone,

      Unfortunately when I’m testing a route containing a micrometer endpoint on Camel 3.20.1 using Spring Boot, then I’m getting a

      java.lang.NullPointerException: null
              at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifierNamingStrategy.getTags(MicrometerExchangeEventNotifierNamingStrategy.java:53)
              at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.handleDoneEvent(MicrometerExchangeEventNotifier.java:105)
             at org.apache.camel.component.micrometer.eventnotifier.MicrometerExchangeEventNotifier.notify(MicrometerExchangeEventNotifier.java:75)
              […]
      

       

      The exception only occurs in case I’m using:

      producer.send(ExchangeBuilder.anExchange(context).withBody("hello").build());

      It’s working fine in case of

      producer.sendBody(“hello”);

      For both statements, in 3.18.3 it’s working fine – in any case, meaning in 3.18.3 and 3.20.1, the ExchangeBuilder.anExchange(context).withBody("hello").build().getEndpointFrom() is null, however, only in 3.20.1 it looks like that getEndpointFrom() indirectly causes the NPE in line 53.

      Pls. find a repo case attached.repro.zip

      Attachments

        1. repro.zip
          1.02 MB
          Andreas Klug

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              andreas.klug2@de.bosch.com Andreas Klug
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: