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:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isNoop()
Says whether the implementation does nothing or not.prePublish
(String stream, Message message) Start observation.void
Callback when the message is about to be published.subscribe
(MessageHandler handler) Decorate consumer registration.
-
Field Details
-
NO_OP
-
-
Method Details
-
prePublish
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
Callback when the message is about to be published.- Parameters:
context
- the observation contextmessage
- the message to publish
-
subscribe
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
-