php-enqueue / enqueue-dev

Message Queue, Job Queue, Broadcasting, WebSockets packages for PHP, Symfony, Laravel, Magento. DEVELOPMENT REPOSITORY - provided by Forma-Pro
https://enqueue.forma-pro.com/
MIT License
2.17k stars 429 forks source link

fix: redis redelivery_delay setting does not work #1343

Open compwright opened 5 months ago

compwright commented 5 months ago

When using the redis transport, RedisConsumer::processResult() creates the redelivered record prior to the RedisSubscription callback executing. The subscription callback attached with Enqueue\Consumption\QueueConsumer then invokes RedisConsumer::reject().

Calling acknowledge() here deletes the redelivered record which was created earlier. Thus, we should not create a new record in reject() and we should only call acknowledge() if we do not wish to redeliver.

I have tested and confirmed that this change fixes the issue. However, if there is a better solution, please advise.

Resolves #1342