Class ObservationPropagationChannelInterceptor
java.lang.Object
org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
org.springframework.integration.channel.interceptor.ObservationPropagationChannelInterceptor
- All Implemented Interfaces:
ChannelInterceptor,ExecutorChannelInterceptor
public class ObservationPropagationChannelInterceptor
extends ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
The
ExecutorChannelInterceptor
implementation responsible for an Observation propagation from one message
flow's thread to another through the MessageChannels involved in the flow.
Opens a new Observation.Scope on another thread and cleans up it in the end.- Since:
- 6.0
- Author:
- Artem Bilan
-
Constructor Summary
ConstructorsConstructorDescriptionObservationPropagationChannelInterceptor(io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex) protected io.micrometer.observation.ObservationobtainPropagatingContext(Message<?> message, MessageChannel channel) protected voidpopulatePropagatedContext(io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) Methods inherited from class org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor
beforeHandle, postReceive, preSendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postSend, preReceive
-
Constructor Details
-
ObservationPropagationChannelInterceptor
public ObservationPropagationChannelInterceptor(io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
obtainPropagatingContext
@Nullable protected io.micrometer.observation.Observation obtainPropagatingContext(Message<?> message, MessageChannel channel) - Specified by:
obtainPropagatingContextin classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
populatePropagatedContext
protected void populatePropagatedContext(@Nullable io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) - Specified by:
populatePropagatedContextin classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
afterMessageHandled
public void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex)
-