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
metricsCollectorFields inherited from class com.rabbitmq.client.impl.AMQChannel
_blockContent, _channelLock, _channelLockCondition, _rpcTimeout, NO_RPC_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionRecoveryAwareChannelN(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 TypeMethodDescriptionvoidbasicAck(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.longlongprotected voidprocessDelivery(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, waitForConfirmsOrDieMethods 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, wrapTimeoutExceptionMethods inherited from class com.rabbitmq.client.impl.ShutdownNotifierComponent
addShutdownListener, getCloseReason, isOpen, notifyListeners, removeShutdownListener, setShutdownCauseIfOpenMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.rabbitmq.client.Channel
getChannelNumber, getConnectionMethods 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:
processDeliveryin classChannelN
-
basicAck
Description 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:
-
basicNack
Description copied from class:ChannelNPublic API - Reject one or several received messages. Supply thedeliveryTagfrom theAMQP.Basic.GetOkorAMQP.Basic.Delivermethod 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:
-
basicReject
Description 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:
-
getMaxSeenDeliveryTag
public long getMaxSeenDeliveryTag() -
getActiveDeliveryTagOffset
public long getActiveDeliveryTagOffset()
-