Open wxxiong6 opened 5 years ago
Next try should increment $attempt
. Can you share logs of two sequential tries of the same job?
I used amqp deivers .
The driver does not support retry.
see yii2-queue/src/drivers/amqp/Queue.php:63
public function listen()
{
$this->open();
$callback = function (AMQPMessage $payload) {
$id = $payload->get('message_id');
list($ttr, $message) = explode(';', $payload->body, 2);
if ($this->handleMessage($id, $message, $ttr, 1)) {
$payload->delivery_info['channel']->basic_ack($payload->delivery_info['delivery_tag']);
}
};
$this->channel->basic_qos(null, 1, null);
$this->channel->basic_consume($this->queueName, '', false, false, false, false, $callback);
while (count($this->channel->callbacks)) {
$this->channel->wait();
}
}
amqp_interop drivers can use retry but need to upgrade PHP version to 7.1.3.
How do I use retry?
output
1 ============ canRetry The attempt is always 1