Recover Method

Request that the server redeliver all messages on a given channel that have not been acknowledged.

Syntax

int Recover(const QString& qsChannelName, bool bRequeue);

Remarks

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 MessageIn 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.

Error Handling

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 Qt Edition - Version 20.0 [Build 8155]