Class RecoveryAwareChannelN
- java.lang.Object
-
- com.rabbitmq.client.impl.ShutdownNotifierComponent
-
- com.rabbitmq.client.impl.AMQChannel
-
- com.rabbitmq.client.impl.ChannelN
-
- com.rabbitmq.client.impl.recovery.RecoveryAwareChannelN
-
- All Implemented Interfaces:
Channel,ShutdownNotifier
public class RecoveryAwareChannelN extends ChannelN
ChannelNmodification that keeps track of delivery tags and avoids sendingbasic.ack
,basic.nack
, andbasic.reject
for stale tags.- Since:
- 3.3.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.rabbitmq.client.impl.AMQChannel
AMQChannel.BlockingRpcContinuation<T>, AMQChannel.RpcContinuation, AMQChannel.SimpleBlockingRpcContinuation
-
-
Field Summary
-
Fields inherited from class com.rabbitmq.client.impl.ChannelN
metricsCollector
-
Fields inherited from class com.rabbitmq.client.impl.AMQChannel
_blockContent, _channelMutex, _rpcTimeout, NO_RPC_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService)Construct a new channel on the given connection with the given channel number.RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService, MetricsCollector metricsCollector)Construct a new channel on the given connection with the given channel number.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbasicAck(long deliveryTag, boolean multiple)Public API - Public API - Acknowledge one or several received messages.voidbasicNack(long deliveryTag, boolean multiple, boolean requeue)Public API - Public API - Reject one or several received messages.voidbasicReject(long deliveryTag, boolean requeue)Public API - Public API - Reject a message.longgetActiveDeliveryTagOffset()longgetMaxSeenDeliveryTag()protected voidprocessDelivery(Command command, AMQImpl.Basic.Deliver method)-
Methods inherited from class com.rabbitmq.client.impl.ChannelN
abort, abort, addConfirmListener, addFlowListener, addReturnListener, asyncRpc, basicCancel, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicGet, basicPublish, basicPublish, basicPublish, basicQos, basicQos, basicQos, basicRecover, basicRecover, clearConfirmListeners, clearFlowListeners, clearReturnListeners, close, close, close, confirmSelect, consumerCount, enqueueRpc, exchangeBind, exchangeBind, exchangeBindNoWait, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclare, exchangeDeclareNoWait, exchangeDeclareNoWait, exchangeDeclarePassive, exchangeDelete, exchangeDelete, exchangeDeleteNoWait, exchangeUnbind, exchangeUnbind, exchangeUnbindNoWait, flowBlocked, getDefaultConsumer, getNextPublishSeqNo, markRpcFinished, messageCount, open, processAsync, processShutdownSignal, queueBind, queueBind, queueBindNoWait, queueDeclare, queueDeclare, queueDeclareNoWait, queueDeclarePassive, queueDelete, queueDelete, queueDeleteNoWait, queuePurge, queueUnbind, queueUnbind, removeConfirmListener, removeFlowListener, removeReturnListener, rpc, setDefaultConsumer, txCommit, txRollback, txSelect, waitForConfirms, waitForConfirms, waitForConfirmsOrDie, waitForConfirmsOrDie
-
Methods inherited from class com.rabbitmq.client.impl.AMQChannel
ensureIsOpen, exnWrappingRpc, getChannelNumber, getConnection, handleCompleteInboundCommand, handleFrame, isOutstandingRpc, nextOutstandingRpc, notifyOutstandingRpc, quiescingRpc, quiescingTransmit, quiescingTransmit, rpc, rpc, toString, transmit, transmit, wrap, wrap, wrapTimeoutException
-
Methods inherited from class com.rabbitmq.client.impl.ShutdownNotifierComponent
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener, setShutdownCauseIfOpen
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.rabbitmq.client.Channel
getChannelNumber, getConnection
-
Methods inherited from interface com.rabbitmq.client.ShutdownNotifier
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener
-
-
-
-
Constructor Detail
-
RecoveryAwareChannelN
public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService)
Construct a new channel on the given connection with the given channel number. Usually not called directly - call Connection.createChannel instead.- Parameters:
connection- The connection associated with this channelchannelNumber- The channel number to be associated with this channelworkService- service for managing this channel's consumer callbacks
-
RecoveryAwareChannelN
public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService, MetricsCollector metricsCollector)
Construct a new channel on the given connection with the given channel number. Usually not called directly - call Connection.createChannel instead.- Parameters:
connection- The connection associated with this channelchannelNumber- The channel number to be associated with this channelworkService- service for managing this channel's consumer callbacksmetricsCollector- service for managing metrics
-
-
Method Detail
-
processDelivery
protected void processDelivery(Command command, AMQImpl.Basic.Deliver method)
- Overrides:
processDeliveryin classChannelN
-
basicAck
public void basicAck(long deliveryTag, boolean multiple) throws IOExceptionDescription copied from class:ChannelNPublic API - Acknowledge one or several received messages. Supply the deliveryTag from theAMQP.Basic.GetOkorAMQP.Basic.Delivermethod containing the received message being acknowledged.- Specified by:
basicAckin interfaceChannel- Overrides:
basicAckin classChannelN- Parameters:
deliveryTag- the tag from the receivedAMQP.Basic.GetOkorAMQP.Basic.Delivermultiple- true to acknowledge all messages up to and including the supplied delivery tag; false to acknowledge just the supplied delivery tag.- Throws:
IOException- if an error is encountered- See Also:
AMQP.Basic.Ack
-
basicNack
public void basicNack(long deliveryTag, boolean multiple, boolean requeue) throws IOExceptionDescription copied from class:ChannelNPublic API - Reject one or several received messages. Supply thedeliveryTagfrom theAMQP.Basic.GetOkorAMQP.Basic.GetOkmethod containing the message to be rejected.- Specified by:
basicNackin interfaceChannel- Overrides:
basicNackin classChannelN- Parameters:
deliveryTag- the tag from the receivedAMQP.Basic.GetOkorAMQP.Basic.Delivermultiple- true to reject all messages up to and including the supplied delivery tag; false to reject just the supplied delivery tag.requeue- true if the rejected message(s) should be requeued rather than discarded/dead-lettered- Throws:
IOException- if an error is encountered- See Also:
AMQP.Basic.Nack
-
basicReject
public void basicReject(long deliveryTag, boolean requeue) throws IOExceptionDescription copied from class:ChannelNPublic API - Reject a message. Supply the deliveryTag from theAMQP.Basic.GetOkorAMQP.Basic.Delivermethod containing the received message being rejected.- Specified by:
basicRejectin interfaceChannel- Overrides:
basicRejectin classChannelN- Parameters:
deliveryTag- the tag from the receivedAMQP.Basic.GetOkorAMQP.Basic.Deliverrequeue- true if the rejected message should be requeued rather than discarded/dead-lettered- Throws:
IOException- if an error is encountered- See Also:
AMQP.Basic.Reject
-
getMaxSeenDeliveryTag
public long getMaxSeenDeliveryTag()
-
getActiveDeliveryTagOffset
public long getActiveDeliveryTagOffset()
-
-