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
@Deprecated(since="6.1.7",
forRemoval=true)
public class ObservationPropagationChannelInterceptor
extends ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
Deprecated, for removal: This API element is subject to removal in a future version.
since 6.1.7 for removal in 6.4 in favor of enabling observation on the channel and its consumer.
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.
NOTE: This interceptor is proven to be wrong since an existing observation usually is closed
on the sender side before the message is consumed on the receiver side.
Therefore, it is better to have a sender
observation on this channel,
and then receiver
observation on a subscriber for this channel.
This way a tracing information is stored into message headers passing this channel.
Such an approach also eliminate a problem with persistent message channels where
an Observation
is not serializable to be stored into database as a part of the message.
- Since:
- 6.0
- Author:
- Artem Bilan
-
Constructor Summary
ConstructorDescriptionObservationPropagationChannelInterceptor
(io.micrometer.observation.ObservationRegistry observationRegistry) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterMessageHandled
(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex) Deprecated, for removal: This API element is subject to removal in a future version.protected io.micrometer.observation.Observation
obtainPropagatingContext
(Message<?> message, MessageChannel channel) Deprecated, for removal: This API element is subject to removal in a future version.protected void
populatePropagatedContext
(io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) Deprecated, for removal: This API element is subject to removal in a future version.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) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
obtainPropagatingContext
@Nullable protected io.micrometer.observation.Observation obtainPropagatingContext(Message<?> message, MessageChannel channel) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
obtainPropagatingContext
in classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
populatePropagatedContext
protected void populatePropagatedContext(@Nullable io.micrometer.observation.Observation state, Message<?> message, MessageChannel channel) Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
populatePropagatedContext
in classThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
-
afterMessageHandled
public void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex) Deprecated, for removal: This API element is subject to removal in a future version.
-