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

Trace id is not carried forwarded in case of threads() used in route #11

Open
PradeepNain opened this issue Aug 5, 2021 · 3 comments
Open

Comments

@PradeepNain
Copy link
Contributor

PradeepNain commented Aug 5, 2021

Hi, We are using sleuth camel.
We get the traces from the API and carry forward the trace in b3 header to camel.
Everything was working fine, but then we started using the threads() in the route, after that all the trace is not getting carried forward and is broken.
We are not able to visualize the traces.

Before: working
from(kafkaProperties)
.routeId(ROUTE_ID)
.process()..

After: Not working
from(kafkaProperties)
.threads()
.executorService(executorService)
.routeId(ROUTE_ID)
.process()..

New traces are getting created per processor

@tdanylchuk
Copy link
Contributor

Unfortunately, multithreading(splitting pipeline) is not supported by this lib, not sure if we going to invest time on that, but any help would be much appreciated.

@PradeepNain
Copy link
Contributor Author

@PradeepNain
Copy link
Contributor Author

Found a way
If you use TraceableExecutorService, it carries the trace id across.
https://docs.spring.io/spring-cloud-sleuth/docs/current/reference/html/integrations.html#sleuth-async-executor-service-integration

I'll raise a PR with updated Readme.

TraceableExecutorService traceableExecutorService = new TraceableExecutorService(beanFactory, executorService);

from(kafkaProperties)
.threads()
.executorService(traceableExecutorService)

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