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.ChannelInstances 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 interfacePublisherCallbackChannel.ListenerListeners 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 StringRETURN_LISTENER_CORRELATION_KEYHeader used to determine which listener to invoke for a returned message.static StringRETURNED_MESSAGE_CORRELATION_KEYHeader used to locate a pending confirm to which to attach a returned message.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(PublisherCallbackChannel.Listener listener)voidaddPendingConfirm(PublisherCallbackChannel.Listener listener, long seq, PendingConfirm pendingConfirm)Adds a pending confirmation to this channel's map.Collection<PendingConfirm>expire(PublisherCallbackChannel.Listener listener, long cutoffTime)Expire (remove) anyPendingConfirms created before cutoffTime for the supplied listener and return them to the caller.com.rabbitmq.client.ChannelgetDelegate()Use this to invoke methods on the underlying rabbit clientChannelthat are not supported by this implementation.intgetPendingConfirmsCount()Get the total pending confirms count.intgetPendingConfirmsCount(PublisherCallbackChannel.Listener listener)Get thePendingConfirms count.voidsetAfterAckCallback(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
-
-
-
-
Field Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
-
Method Detail
-
addListener
void addListener(PublisherCallbackChannel.Listener listener)
- Parameters:
listener- The Listener.
-
expire
Collection<PendingConfirm> expire(PublisherCallbackChannel.Listener listener, long cutoffTime)
Expire (remove) anyPendingConfirms 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 thePendingConfirms 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 clientChannelthat 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
-
-