[
https://issues.apache.org/jira/browse/CAMEL-21472?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17900972#comment-17900972
]
Thomas Gantenbein commented on CAMEL-21472:
-------------------------------------------
[~pcongiusti], I think it doesn't have to do anything with the component used,
after all, but with the `ThreadLocalContextStorage`. Netty is using a several
worker threads, while the file or timer component use the same thread. If I
repeat the request to the netty route in
[https://github.com/thomas-gantenbein-tga/camel-opentelemetry/blob/main/src/main/java/org/example/MySpringBootRouter.java#L18]
frequently enough (I fired it 100 times with "for run in \{1..100}; do curl
localhost:12345 & done") I manage to get the same traceIds for subsequent
requests, too.
Here are the logs from the reproducer after having it run through grep "in
netty" | grep -Po 'thread.*' | sort:
{code:java}
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,1cce18f3597f5cf1] netty - in netty route
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,6acdf9db4a88fc47] netty - in netty route
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,8430524b2125075c] netty - in netty route
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,add494bb4de6c0a0] netty - in netty route
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,d2b4040f1fcc364b] netty - in netty route
thread #10 - NettyConsumerExecutorGroup
[d05defb0897c489aaaa28809ed6e0225,f2f5db974223b4cd] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,2287c028952851b8] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,408782d7423d9991] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,82c9d51db597d810] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,877bb45250ae6a69] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,9942fdd7f07c4be1] netty - in netty route
thread #14 - NettyConsumerExecutorGroup
[95129fc26654d41c20190a5043f99c4b,de36e208f75a1d05] netty - in netty route
{code}
> Opentelemetry is using the same traceId when exchange is fired from file or
> timer component
> -------------------------------------------------------------------------------------------
>
> Key: CAMEL-21472
> URL: https://issues.apache.org/jira/browse/CAMEL-21472
> Project: Camel
> Issue Type: Bug
> Components: camel-opentelemetry
> Affects Versions: 4.8.1
> Reporter: Thomas Gantenbein
> Priority: Major
> Fix For: 4.8.2, 4.9.0
>
>
> *Problem*
> When using a consumer like {{timer}} or {{{}file{}}}, the traceId remains the
> same for all messages. When using a consumer like netty (or, I assume, any
> other http/tcp-based consumer), every call gets its own traceId as expected.
> See also
> https://camel.zulipchat.com/#narrow/channel/257298-camel/topic/Same.20OTEL.20trace.20for.20all.20messages.20into.20IBM.20MQ
> *Reproducer*
> [https://github.com/thomas-gantenbein-tga/camel-opentelemetry/tree/main]
> [~pcongiusti], thanks for your answer on Zulip Chat. Let me know if I should
> further explain or minimize that reproducer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)