Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
3.21.1
-
None
-
Unknown
Description
The Tracing Strategy is failing when using pollEnrich with seda endpoint.
Here is the reproducer https://github.com/RuslanHryn/camel-tracing-issue
Run RouteTest to reproduce the issue
This issue is reproducible on both tracing strategies: OpenTracingTracingStrategy
and OpenTelemetryTracingStrategy
For example, we have the following routes:
from("direct:firstRoute") .pollEnrich("seda:secondRoute", 0) .process(exchange -> { // }); from("seda:secondRoute") .process(exchange -> { // });
and we set a tracing strategy
ottracer.setTracingStrategy(new OpenTelemetryTracingStrategy(ottracer)); or ottracer.setTracingStrategy(new OpenTracingTracingStrategy(ottracer));
After sending messages the route will fail with
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.camel.opentelemetry.OpenTelemetrySpanAdapter.getOpenTelemetrySpan()" because "spanWrapper" is null at org.apache.camel.opentelemetry.OpenTelemetryTracingStrategy.lambda$wrapProcessorInInterceptors$0(OpenTelemetryTracingStrategy.java:52) at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) at org.apache.camel.support.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:104) at org.apache.camel.support.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:104) at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:477) at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:181) at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:59) at org.apache.camel.processor.Pipeline.process(Pipeline.java:165) at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:390) at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:96) at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:214) at org.apache.camel.impl.engine.SharedCamelInternalProcessor$1.process(SharedCamelInternalProcessor.java:111) at org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83) at org.apache.camel.impl.engine.SharedCamelInternalProcessor.process(SharedCamelInternalProcessor.java:108) at org.apache.camel.support.cache.DefaultProducerCache.send(DefaultProducerCache.java:199) at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:176) at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:172) at org.apache.camel.impl.engine.DefaultProducerTemplate.send(DefaultProducerTemplate.java:153) at org.apache.camel.impl.engine.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:187)