-
Notifications
You must be signed in to change notification settings - Fork 7
Description
https://www.javadoc.io/doc/org.apache.camel/camel-api/latest/org/apache/camel/Exchange.html
getFromEndpoint() - Returns the endpoint which originated this message exchange if a consumer on an endpoint created the message exchange, otherwise his property will be null.
I'm using this library w/ Apache Camel 3.13.0 and Spring Boot 2.5.x. I'm receiving a ton of NPEs since getFromEndpoint can be null, whenever a consumer on an endpoint didn't create the message exchange. This can be a problem when using direct routes, and I suspect it'll also be problematic when using forceCompletion via an AggregationController.
In general, I think it'd be safer to use getFromRouteId, though this can be null as well. However I haven't seen that happen yet in my testing.
I also noticed that all of the exchanges throwing an NPE already have a SpanId / TraceId assigned via the Exchange headers. Is there a reason that we need to create a new span at all? Or can we just use the possiblyExistingSpan?