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:
  • 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 to
      routingKey - the routing key
      message - the published message
      connectionInfo - information on the connection
      publishCall - the actual publish call
      Returns:
      some context returned by the publish call
    • subscribe

      Decorate a Consumer.MessageHandler to observe the delivery of messages.
      Parameters:
      queue - the queue the consumer subscribes to
      handler - the application message delivery handler
      Returns:
      the decorated handler