Interface PublisherCallbackChannel

All Superinterfaces:
AutoCloseable, com.rabbitmq.client.Channel, com.rabbitmq.client.ShutdownNotifier
All Known Implementing Classes:
PublisherCallbackChannelImpl

public interface PublisherCallbackChannel extends com.rabbitmq.client.Channel
Instances of this interface support a single listener being registered for publisher confirms with multiple channels, by adding context to the callbacks.
Since:
1.0.1
Author:
Gary Russell
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Listeners implementing this interface can participate in publisher confirms received from multiple channels, by invoking addListener on each channel.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Header used to determine which listener to invoke for a returned message.
    static final String
    Header used to locate a pending confirm to which to attach a returned message.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    void
    Adds a pending confirmation to this channel's map.
    expire(PublisherCallbackChannel.Listener listener, long cutoffTime)
    Expire (remove) any PendingConfirms created before cutoffTime for the supplied listener and return them to the caller.
    com.rabbitmq.client.Channel
    Use this to invoke methods on the underlying rabbit client Channel that are not supported by this implementation.
    int
    Get the total pending confirms count.
    int
    Get the PendingConfirms count.
    void
    setAfterAckCallback(Consumer<com.rabbitmq.client.Channel> callback)
    Set a callback to be invoked after the ack/nack has been handled.

    Methods inherited from interface com.rabbitmq.client.Channel

    abort, abort, addConfirmListener, addConfirmListener, addReturnListener, addReturnListener, asyncCompletableRpc, asyncRpc, basicAck, basicCancel, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicGet, basicNack, basicPublish, basicPublish, basicPublish, basicQos, basicQos, basicQos, basicRecover, basicRecover, basicReject, clearConfirmListeners, clearReturnListeners, close, close, confirmSelect, consumerCount, exchangeBind, exchangeBind, exchangeBindNoWait, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclareNoWait, exchangeDeclareNoWait, exchangeDeclarePassive, exchangeDelete, exchangeDelete, exchangeDeleteNoWait, exchangeUnbind, exchangeUnbind, exchangeUnbindNoWait, getChannelNumber, getConnection, getDefaultConsumer, getNextPublishSeqNo, messageCount, queueBind, queueBind, queueBindNoWait, queueDeclare, queueDeclare, queueDeclareNoWait, queueDeclarePassive, queueDelete, queueDelete, queueDeleteNoWait, queuePurge, queueUnbind, queueUnbind, removeConfirmListener, removeReturnListener, rpc, setDefaultConsumer, txCommit, txRollback, txSelect, waitForConfirms, waitForConfirms, waitForConfirmsOrDie, waitForConfirmsOrDie

    Methods inherited from interface com.rabbitmq.client.ShutdownNotifier

    addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener
  • Field Details

    • RETURN_LISTENER_CORRELATION_KEY

      static final String RETURN_LISTENER_CORRELATION_KEY
      Header used to determine which listener to invoke for a returned message.
      See Also:
    • RETURNED_MESSAGE_CORRELATION_KEY

      static final String RETURNED_MESSAGE_CORRELATION_KEY
      Header used to locate a pending confirm to which to attach a returned message.
      See Also:
  • Method Details

    • addListener

      void addListener(PublisherCallbackChannel.Listener listener)
      Parameters:
      listener - The Listener.
    • expire

      Collection<PendingConfirm> expire(PublisherCallbackChannel.Listener listener, long cutoffTime)
      Expire (remove) any PendingConfirms created before cutoffTime for the supplied listener and return them to the caller.
      Parameters:
      listener - the listener.
      cutoffTime - the time before which expired messages were created.
      Returns:
      the list of expired confirms.
    • getPendingConfirmsCount

      int getPendingConfirmsCount(PublisherCallbackChannel.Listener listener)
      Get the PendingConfirms count.
      Parameters:
      listener - the listener.
      Returns:
      Count of the pending confirms.
    • getPendingConfirmsCount

      int getPendingConfirmsCount()
      Get the total pending confirms count.
      Returns:
      the count.
      Since:
      2.1
    • addPendingConfirm

      void addPendingConfirm(PublisherCallbackChannel.Listener listener, long seq, PendingConfirm pendingConfirm)
      Adds a pending confirmation to this channel's map.
      Parameters:
      listener - The listener.
      seq - The key to the map.
      pendingConfirm - The PendingConfirm object.
    • getDelegate

      com.rabbitmq.client.Channel getDelegate()
      Use this to invoke methods on the underlying rabbit client Channel that are not supported by this implementation.
      Returns:
      The underlying rabbit client Channel.
      Since:
      1.4.
    • setAfterAckCallback

      void setAfterAckCallback(Consumer<com.rabbitmq.client.Channel> callback)
      Set a callback to be invoked after the ack/nack has been handled.
      Parameters:
      callback - the callback.
      Since:
      2.1