Interface MessageObservationCollector<T extends ObservationContext>

Type Parameters:
T - the type of the observation context

public interface MessageObservationCollector<T extends ObservationContext>
The observation collector is called with the new message and returns the message observation that will be used to observe messages from their creation until the ack or the nack event

The implementation of this interface must be a CDI managed bean in order to be discovered

  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    initObservation(String channel, boolean incoming, boolean emitter)
    Initialize observation for the given channel If null is returned the observation for the given channel is disabled
    onNewMessage(String channel, Message<?> message, T observationContext)
    Returns a new MessageObservation object on which to collect the message processing events.
  • Method Details

    • initObservation

      default T initObservation(String channel, boolean incoming, boolean emitter)
      Initialize observation for the given channel If null is returned the observation for the given channel is disabled
      Parameters:
      channel - the channel of the message
      incoming - whether the channel is incoming or outgoing
      emitter - whether the channel is an emitter
      Returns:
      the observation context
    • onNewMessage

      MessageObservation onNewMessage(String channel, Message<?> message, T observationContext)
      Returns a new MessageObservation object on which to collect the message processing events. If initObservation(String, boolean, boolean) is implemented, the ObservationContext object returned from that method will be passed to this method. If not it is called with ObservationContext.DEFAULT and should be ignored.
      Parameters:
      channel - the channel of the message
      message - the message
      observationContext - the observation context
      Returns:
      the message observation