[ 
https://issues.apache.org/jira/browse/CAMEL-27134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Federico Mariani updated CAMEL-27134:
-------------------------------------
    Description: 
{{SpringBootPlatformHttpConsumer}} hands the request over to the task executor 
and runs the route there without the context of the request thread. With 
Micrometer Tracing (for example {{spring-boot-starter-opentelemetry}}) and 
{{camel-opentelemetry2}}, the spans of the route are therefore a separate trace 
from the {{http post ...}} span that Spring MVC records for the same request.

Spring Boot solves this, opt-in, for its task executors: with 
{{spring.task.execution.propagate-context=true}} it decorates 
{{applicationTaskExecutor}}, which the consumer normally uses, with a 
{{ContextPropagatingTaskDecorator}}, and the route then joins the request's 
trace. Context propagation stays opt-in, as in Spring Boot: document the 
property on the platform-http starter page and cover it with a test.

_Claude Code on behalf of Croway_

  was:
{{SpringBootPlatformHttpConsumer}} hands the request over to the application 
task executor and runs the route there without the context of the request 
thread. With Micrometer Tracing (for example 
{{spring-boot-starter-opentelemetry}}) and {{camel-opentelemetry2}}, the spans 
of the route are therefore a separate trace from the {{http post ...}} span 
that Spring MVC records for the same request.

When {{io.micrometer:context-propagation}} is on the classpath (it comes with 
Micrometer Tracing), the consumer can capture the context on the request thread 
and restore it on the executor thread with Spring's 
{{ContextPropagatingTaskDecorator}}, as 
{{spring.task.execution.propagate-context=true}} does for Spring's own 
executors. The route spans then join the request's trace, and other 
thread-local context registered with context-propagation (for example the 
Spring Security context, when its accessor is registered) is available in the 
route.

_Claude Code on behalf of Croway_


        Summary: camel-platform-http-starter - document and test that 
spring.task.execution.propagate-context joins the route to the request's trace  
(was: camel-platform-http-starter - run the route with the context of the HTTP 
request, so its spans join the request's trace)

> camel-platform-http-starter - document and test that 
> spring.task.execution.propagate-context joins the route to the request's trace
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-27134
>                 URL: https://issues.apache.org/jira/browse/CAMEL-27134
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-spring-boot-starters
>            Reporter: Federico Mariani
>            Assignee: Federico Mariani
>            Priority: Major
>
> {{SpringBootPlatformHttpConsumer}} hands the request over to the task 
> executor and runs the route there without the context of the request thread. 
> With Micrometer Tracing (for example {{spring-boot-starter-opentelemetry}}) 
> and {{camel-opentelemetry2}}, the spans of the route are therefore a separate 
> trace from the {{http post ...}} span that Spring MVC records for the same 
> request.
> Spring Boot solves this, opt-in, for its task executors: with 
> {{spring.task.execution.propagate-context=true}} it decorates 
> {{applicationTaskExecutor}}, which the consumer normally uses, with a 
> {{ContextPropagatingTaskDecorator}}, and the route then joins the request's 
> trace. Context propagation stays opt-in, as in Spring Boot: document the 
> property on the platform-http starter page and cover it with a test.
> _Claude Code on behalf of Croway_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to