Uploaded image for project: 'Red Hat build of Apache Camel for Spring Boot'
  1. Red Hat build of Apache Camel for Spring Boot
  2. CSB-3916

NPE occurs If user uses OpenTelemetryTracingStrategy and opentelemetry.exclude-patterns to exclude "direct*"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • CSB-4.4
    • CSB-4.0
    • Camel
    • None
    • Very Likely
    • 0

      In the following condition, NPE occurs.

      • camel-openteremetry
      • Uses OpenTelemetryTracingStrategy [1]
      • Exclude "direct*" by using opentelemetry.exclude-patterns [2]
      • The camel route has "direct:" endpoint [3]

      [1] src/main/java/com/example/camelotel/CamelOtelConfiguration.java

      @Configuration
      public class CamelOtelConfiguration {
        public CamelOtelConfiguration(CamelContext camelContext, OpenTelemetryTracer tracer) {
          var strategy = new OpenTelemetryTracingStrategy(tracer);
          tracer.setTracingStrategy(strategy);
          camelContext.getCamelContextExtension().addInterceptStrategy(strategy);
        }
      }
      

      [2] src/main/resources/application.yml

      opentelemetry:
        exclude-patterns:
          - direct*
      

      [3] src/main/java/com/example/camelotel/camel/AppRouteBuilder.java

        @Override
        public void configure() throws Exception {
      
          from("direct:wiretap-test").id("wiretap-test")
            .wireTap("direct:wiretapped")
            .delay(200)
            .process(messageLoggingProcess);
      
          from("direct:wiretapped")
            .delay(300)
            .process(messageLoggingProcess);
      

      Instruction to reproduce the issue

      NullPointerException.zip
      1: mvn spring-boot:run
      2: curl http://localhost:8080/rest/test/wiretap

        1. OpenTelemetryUpstream.java
          1 kB
          John Poth

              johnpoth John Poth
              rhn-support-hfuruich Hisao Furuichi
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: