Add ThreadLocalAccessor for LocaleContext and RequestAttributes

Add `ThreadLocalAccessor` implementations:
- `LocaleThreadLocalAccessor`
- `RequestAttributesThreadLocalAccessor`

See gh-32243
This commit is contained in:
Tadaya Tsuyukubo
2024-02-11 17:34:17 -08:00
committed by Stéphane Nicoll
parent 5d22aa9770
commit 5bd1c1fddb
7 changed files with 295 additions and 1 deletions

View File

@@ -445,6 +445,13 @@ directly. For example:
}
----
The following `ThreadLocalAccessor` implementations are provided out of the box:
* `LocaleContextThreadLocalAccessor` -- propagates `LocaleContext` via `LocaleContextHolder`
* `RequestAttributesThreadLocalAccessor` -- propagates `RequestAttributes` via `RequestContextHolder`
The above are not registered automatically. You need to register them via `ContextRegistry.getInstance()` on startup.
For more details, see the
https://micrometer.io/docs/contextPropagation[documentation] of the Micrometer Context
Propagation library.