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 MessageChannel
s 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
ConstructorDescriptionObservationPropagationChannelInterceptor
(io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterMessageHandled
(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex) protected io.micrometer.observation.Observation
obtainPropagatingContext
(Message<?> message, MessageChannel channel) protected void
populatePropagatedContext
(io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) Methods inherited from class org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor
beforeHandle, postReceive, preSend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
obtainPropagatingContext
in classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
populatePropagatedContext
protected void populatePropagatedContext(@Nullable io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) - Specified by:
populatePropagatedContext
in classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
afterMessageHandled
public void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex)
-