Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE due to getFromEndpoint #13

Open
furlongce opened this issue Jan 1, 2022 · 6 comments
Open

NPE due to getFromEndpoint #13

furlongce opened this issue Jan 1, 2022 · 6 comments

Comments

@furlongce
Copy link

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?

@furlongce
Copy link
Author

Is there any update on this, or a proposed fix? I'd be happy to implement and submit a PR

@tdanylchuk
Copy link
Contributor

Hello, the repository is in hibernate state, but feel free to submit PR for this, we may initiate the release process once your issue is fixed.

@furlongce
Copy link
Author

Should I just fork it then? I didn't realize it's not being maintained. You might want to update the readme to others won't try to use it

@tdanylchuk
Copy link
Contributor

It's alive ;D and you can contribute to it, it's just not under the maintainers' priority bucket right now.

@furlongce
Copy link
Author

furlongce commented Jan 8, 2022 via email

@tdanylchuk
Copy link
Contributor

it will be released once received fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants