Package com.rabbitmq.client.amqp
Interface ObservationCollector
public interface ObservationCollector
API to observe common message operations.
This interface is considered an SPI and is susceptible to change at any time.
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Information on a connection. -
Method Summary
Modifier and TypeMethodDescription<T> T
publish
(String exchange, String routingKey, Message message, ObservationCollector.ConnectionInfo connectionInfo, Function<Message, T> publishCall) Observe the publishing of a message.subscribe
(String queue, Consumer.MessageHandler handler) Decorate aConsumer.MessageHandler
to observe the delivery of messages.
-
Method Details
-
publish
<T> T publish(String exchange, String routingKey, Message message, ObservationCollector.ConnectionInfo connectionInfo, Function<Message, T> publishCall) Observe the publishing of a message.Implementations must perform the publish call with the provided argument and make their observations "around" it.
- Type Parameters:
T
- type of the context returned by the publish call- Parameters:
exchange
- the exchange the message is published toroutingKey
- the routing keymessage
- the published messageconnectionInfo
- information on the connectionpublishCall
- the actual publish call- Returns:
- some context returned by the publish call
-
subscribe
Decorate aConsumer.MessageHandler
to observe the delivery of messages.- Parameters:
queue
- the queue the consumer subscribes tohandler
- the application message delivery handler- Returns:
- the decorated handler
-