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
Modifier and TypeInterfaceDescriptionstatic interface
Listeners implementing this interface can participate in publisher confirms received from multiple channels, by invoking addListener on each channel. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(PublisherCallbackChannel.Listener listener) void
addPendingConfirm
(PublisherCallbackChannel.Listener listener, long seq, PendingConfirm pendingConfirm) Adds a pending confirmation to this channel's map.expire
(PublisherCallbackChannel.Listener listener, long cutoffTime) Expire (remove) anyPendingConfirm
s 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 clientChannel
that are not supported by this implementation.int
Get the total pending confirms count.int
Get thePendingConfirm
s 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
Header used to determine which listener to invoke for a returned message.- See Also:
-
RETURNED_MESSAGE_CORRELATION_KEY
Header used to locate a pending confirm to which to attach a returned message.- See Also:
-
-
Method Details
-
addListener
- Parameters:
listener
- The Listener.
-
expire
Expire (remove) anyPendingConfirm
s 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
Get thePendingConfirm
s 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 clientChannel
that are not supported by this implementation.- Returns:
- The underlying rabbit client
Channel
. - Since:
- 1.4.
-
setAfterAckCallback
Set a callback to be invoked after the ack/nack has been handled.- Parameters:
callback
- the callback.- Since:
- 2.1
-