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
,AutoCloseable
ChannelN
modification that keeps track of delivery
tags and avoids sending basic.ack,
basic.nack, and
basic.rejectfor 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, _channelLock, _channelLockCondition, _rpcTimeout, NO_RPC_TIMEOUT
-
Constructor Summary
ConstructorDescriptionRecoveryAwareChannelN
(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, ObservationCollector observationCollector) Construct a new channel on the given connection with the given channel number. -
Method Summary
Modifier and TypeMethodDescriptionvoid
basicAck
(long deliveryTag, boolean multiple) Public API - Public API - Acknowledge one or several received messages.void
basicNack
(long deliveryTag, boolean multiple, boolean requeue) Public API - Public API - Reject one or several received messages.void
basicReject
(long deliveryTag, boolean requeue) Public API - Public API - Reject a message.long
long
protected void
processDelivery
(Command command, AMQImpl.Basic.Deliver method) Methods inherited from class com.rabbitmq.client.impl.ChannelN
abort, abort, addConfirmListener, addConfirmListener, addReturnListener, addReturnListener, asyncCompletableRpc, asyncRpc, basicCancel, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicConsume, basicGet, basicPublish, basicPublish, basicPublish, basicQos, basicQos, basicQos, basicRecover, basicRecover, clearConfirmListeners, 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, getDefaultConsumer, getNextPublishSeqNo, markRpcFinished, messageCount, open, processAsync, processShutdownSignal, 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 class com.rabbitmq.client.impl.AMQChannel
asyncRpc, connectionInfo, enqueueAsyncRpc, ensureIsOpen, exnWrappingAsyncRpc, exnWrappingRpc, getChannelNumber, getConnection, handleCompleteInboundCommand, handleFrame, isOutstandingRpc, nextOutstandingRpc, notifyOutstandingRpc, quiescingAsyncRpc, 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 Details
-
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, ObservationCollector observationCollector) 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 Details
-
processDelivery
- Overrides:
processDelivery
in classChannelN
-
basicAck
Description copied from class:ChannelN
Public API - Acknowledge one or several received messages. Supply the deliveryTag from theAMQP.Basic.GetOk
orAMQP.Basic.Deliver
method containing the received message being acknowledged.- Specified by:
basicAck
in interfaceChannel
- Overrides:
basicAck
in classChannelN
- Parameters:
deliveryTag
- the tag from the receivedAMQP.Basic.GetOk
orAMQP.Basic.Deliver
multiple
- 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:
-
basicNack
Description copied from class:ChannelN
Public API - Reject one or several received messages. Supply thedeliveryTag
from theAMQP.Basic.GetOk
orAMQP.Basic.Deliver
method containing the message to be rejected.- Specified by:
basicNack
in interfaceChannel
- Overrides:
basicNack
in classChannelN
- Parameters:
deliveryTag
- the tag from the receivedAMQP.Basic.GetOk
orAMQP.Basic.Deliver
multiple
- 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:
-
basicReject
Description copied from class:ChannelN
Public API - Reject a message. Supply the deliveryTag from theAMQP.Basic.GetOk
orAMQP.Basic.Deliver
method containing the received message being rejected.- Specified by:
basicReject
in interfaceChannel
- Overrides:
basicReject
in classChannelN
- Parameters:
deliveryTag
- the tag from the receivedAMQP.Basic.GetOk
orAMQP.Basic.Deliver
requeue
- true if the rejected message should be requeued rather than discarded/dead-lettered- Throws:
IOException
- if an error is encountered- See Also:
-
getMaxSeenDeliveryTag
public long getMaxSeenDeliveryTag() -
getActiveDeliveryTagOffset
public long getActiveDeliveryTagOffset()
-