Request that the server redeliver all messages on a given channel that have not been acknowledged.
def recover(channel_name: str, requeue: bool) -> None: ...
This method is used to request that the server redeliver all messages that it previously sent to the class on the channel specified by ChannelName which are still awaiting acknowledgement.
A call to this method may cause the server to redeliver zero or more messages over the channel specified by ChannelName. Those messages will cause the on_message_in event to fire with its Redelivered event parameter set to True.
The Requeue parameter controls how the server should attempt to redeliver the messages awaiting acknowledgement. If set to True, the server will simple put the messages back on their original queues, and they will be delivered like any other queued messages (potentially to other consumers). If set to False, the server will redeliver the messages to the class directly.
An exception is thrown if no channel with the given ChannelName exists, or (for RabbitMQ only) if the server returns an error because Requeue was False. (RabbitMQ only supports setting Requeue to True.)
Note that in AMQP, server errors are grouped into "connection errors" and "channel errors", and both are fatal. That is, if the server returns a channel error, it will then close the channel which caused the error; and if it returns a connection error, it will then close the connection. The AMQPClassic class's Error Codes page includes AMQP's various connection and channel errors.