spring-framework/framework-docs/modules/ROOT/pages
Brian Clozel ef2a403df6 Add PropagationContextElement Kotlin operator
Prior to this commit, the Micrometer context-propagation project would
help propagating information from `ThreadLocal`, Reactor `Context` and
other context objects. This is already well supported for Micrometer
Observations.

In the case of Kotlin suspending functions, the processing of tasks
would not necessarily update the `ThreadLocal` when the function is
scheduled on a different thread.

This commit introduces the `PropagationContextElement` operator that
connects the `ThreadLocal`, Reactor `Context` and Coroutine `Context`
for all libraries using the "context-propagation" project.

Applications must manually use this operator in suspending functions
like so:

```
suspend fun suspendingFunction() {
  return withContext(PropagationContextElement(currentCoroutineContext())) {
    logger.info("Suspending function with traceId")
  }
}
```

Closes gh-35185
2025-09-09 21:42:08 +02:00
..
core Document programmatic retry support in the reference manual 2025-09-07 17:58:28 +02:00
data-access Improve wording for transactional rollback rule semantics 2025-08-19 13:32:35 +02:00
integration Remove HttpServiceClient annotation 2025-09-08 13:56:07 +01:00
languages Add PropagationContextElement Kotlin operator 2025-09-09 21:42:08 +02:00
testing Merge branch '6.2.x' 2025-09-03 14:53:20 +02:00
web Polish JSP documentation 2025-09-09 13:36:10 +02:00
appendix.adoc Introduce Spring property for default escape character for placeholders 2025-05-13 13:37:30 +02:00
core.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
data-access.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
index.adoc Use appropriate link for Testing chapter 2025-01-23 10:58:48 +01:00
integration.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
languages.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
overview.adoc Remove Undertow-specific support and testing 2025-08-20 10:32:33 +02:00
page-layout.adoc Remove unnecessary asciidoc attributes 2023-05-04 15:35:05 +01:00
rsocket.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
testing.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
web-reactive.adoc Remove Undertow-specific support and testing 2025-08-20 10:32:33 +02:00
web.adoc Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00