@ -358,14 +358,14 @@ By default, event publication and processing is done synchronously and on the sa
@@ -358,14 +358,14 @@ By default, event publication and processing is done synchronously and on the sa
This means that during the execution of that task, the ThreadLocals and logging context will be the same as the event publisher.
If the application configures globally a custom `ApplicationEventMulticaster` with a strategy that schedules event processing on different threads, this is no longer true.
All `@EventListener` methods will be processed on a different thread, outstide of the main event publication thread.
All `@EventListener` methods will be processed on a different thread, outside of the main event publication thread.
In these cases, the https://micrometer.io/docs/contextPropagation[Micrometer Context Propagation library] can help propagating such values and better correlate the processing of the events.
The application can configure the chosen `TaskExecutor` to use a `ContextPropagatingTaskDecorator` that decorates tasks and propagates context.
For this to work, the `io.micrometer:context-propagation` library must be present on the classpath:
include-code::./ApplicationEventsConfiguration[]
Similarly, if that asynchronous choice is made locally for each `@EventListener` annotated method, by adding an `@Async` method to it,
Similarly, if that asynchronous choice is made locally for each `@EventListener` annotated method, by adding an `@Async` to it,
you can choose a `TaskExecutor` that propagates context by referring to it by its qualifier.
Given the following `TaskExecutor` bean definition, configured with the dedicated task decorator:
@ -248,7 +248,7 @@ For example, declaring `List<Foo>` in Kotlin is conceptually equivalent to `java
@@ -248,7 +248,7 @@ For example, declaring `List<Foo>` in Kotlin is conceptually equivalent to `java
@ -511,7 +511,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
@@ -511,7 +511,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
@ -240,7 +240,7 @@ public class MethodValidationInterceptor implements MethodInterceptor {
@@ -240,7 +240,7 @@ public class MethodValidationInterceptor implements MethodInterceptor {
@ -54,7 +54,7 @@ final class OutputStreamPublisher implements Publisher<DataBuffer> {
@@ -54,7 +54,7 @@ final class OutputStreamPublisher implements Publisher<DataBuffer> {
@ -99,7 +99,7 @@ final class OutputStreamPublisher implements Publisher<DataBuffer> {
@@ -99,7 +99,7 @@ final class OutputStreamPublisher implements Publisher<DataBuffer> {
@ -49,7 +49,7 @@ public class SingletonSupplier<T> implements Supplier<T> {
@@ -49,7 +49,7 @@ public class SingletonSupplier<T> implements Supplier<T> {
@ -115,7 +115,7 @@ public class ServerHttpObservationFilter implements WebFilter {
@@ -115,7 +115,7 @@ public class ServerHttpObservationFilter implements WebFilter {
@ -1049,7 +1049,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
@@ -1049,7 +1049,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter