Class ObservationPropagationChannelInterceptor

java.lang.Object
org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
org.springframework.integration.channel.interceptor.ObservationPropagationChannelInterceptor
All Implemented Interfaces:
org.springframework.messaging.support.ChannelInterceptor, org.springframework.messaging.support.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
  • Constructor Details

    • ObservationPropagationChannelInterceptor

      public ObservationPropagationChannelInterceptor(io.micrometer.observation.ObservationRegistry observationRegistry)
  • Method Details

    • obtainPropagatingContext

      @Nullable protected io.micrometer.observation.Observation obtainPropagatingContext(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)
      Specified by:
      obtainPropagatingContext in class ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
    • populatePropagatedContext

      protected void populatePropagatedContext(@Nullable io.micrometer.observation.Observation state, org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)
      Specified by:
      populatePropagatedContext in class ThreadStatePropagationChannelInterceptor<io.micrometer.observation.Observation>
    • afterMessageHandled

      public void afterMessageHandled(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel, org.springframework.messaging.MessageHandler handler, Exception ex)