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 TypeMethodDescriptiondefault TinitObservation(String channel, boolean incoming, boolean emitter) Initialize observation for the given channel Ifnullis returned the observation for the given channel is disabledonNewMessage(String channel, Message<?> message, T observationContext) Returns a newMessageObservationobject on which to collect the message processing events.
-
Method Details
-
initObservation
Initialize observation for the given channel Ifnullis returned the observation for the given channel is disabled- Parameters:
channel- the channel of the messageincoming- whether the channel is incoming or outgoingemitter- whether the channel is an emitter- Returns:
- the observation context
-
onNewMessage
Returns a newMessageObservationobject on which to collect the message processing events. IfinitObservation(String, boolean, boolean)is implemented, theObservationContextobject returned from that method will be passed to this method. If not it is called withObservationContext.DEFAULTand should be ignored.- Parameters:
channel- the channel of the messagemessage- the messageobservationContext- the observation context- Returns:
- the message observation
-