Package com.rabbitmq.stream
Interface ObservationCollector<T>
-
public interface ObservationCollector<T>API to instrument operations in the stream client. The supported operations are publishing, and asynchronous delivery.Implementations can gather information and send it to tracing backends. This allows e.g. following the processing steps of a given message through different systems.
This is considered an SPI and is susceptible to change at any time.
- Since:
- 0.12.0
- See Also:
EnvironmentBuilder.observationCollector(ObservationCollector),MicrometerObservationCollectorBuilder
-
-
Field Summary
Fields Modifier and Type Field Description static ObservationCollector<Void>NO_OP
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanisNoop()Says whether the implementation does nothing or not.TprePublish(String stream, Message message)Start observation.voidpublished(T context, Message message)Callback when the message is about to be published.MessageHandlersubscribe(MessageHandler handler)Decorate consumer registration.
-
-
-
Field Detail
-
NO_OP
static final ObservationCollector<Void> NO_OP
-
-
Method Detail
-
prePublish
T prePublish(String stream, Message message)
Start observation.Implementations are expecting to return an observation context that will be passed in to the
published(Object, Message)callback.- Parameters:
stream- the stream to publish tomessage- the message to publish- Returns:
- observation context
-
published
void published(T context, Message message)
Callback when the message is about to be published.- Parameters:
context- the observation contextmessage- the message to publish
-
subscribe
MessageHandler subscribe(MessageHandler handler)
Decorate consumer registration.- Parameters:
handler- the original handler- Returns:
- a decorated handler
-
isNoop
default boolean isNoop()
Says whether the implementation does nothing or not.- Returns:
- true if the implementation is a no-op
-
-