Class MessageTap

  • All Implemented Interfaces:
    Consumer<org.apache.qpid.proton.message.Message>

    public final class MessageTap
    extends Object
    implements Consumer<org.apache.qpid.proton.message.Message>
    A consumer that inspects a received message to detect if it indicates that a device should be currently ready to receive an upstream message. Depending on the outcome the passed callbacks are invoked (effectively implementing a tap).
    • Method Detail

      • getConsumer

        public static Consumer<org.apache.qpid.proton.message.Message> getConsumer​(Consumer<org.apache.qpid.proton.message.Message> messageConsumer,
                                                                                   Consumer<TimeUntilDisconnectNotification> notificationReadyToDeliverConsumer)
        Construct a message consumer that detects an indication that a device is ready to receive an upstream message and delegates to the passed callback handlers.
        Parameters:
        messageConsumer - Message consumer that handles generic messages.
        notificationReadyToDeliverConsumer - Consumer<TimeUntilDisconnectNotification> that is called when the message indicates the current readiness to receive an upstream message.
        Returns:
        The message consumer that invokes the specific handlers depending on the event type.
        Throws:
        NullPointerException - if any of the parameters are null.
      • accept

        public void accept​(org.apache.qpid.proton.message.Message msg)
        Specified by:
        accept in interface Consumer<org.apache.qpid.proton.message.Message>