attempts not working as expected
When using php artisan queue:work --sleep=3 --tries=3 the attempts attribute will not be updated so the job will be retried for an infinite amount of time. If we set --tries to 1, the job will be processed once
How should we fix this?
Normally the attempt is stored in the job object itself. This is a problem in kafka, because the jobs are immutable. We can store an attempt elsewhere for example a cache. But using kafka where the queue is persistent we should be able to complete all jobs without failing.
@petermein I checked the RabbitMQ library for Laravel and I found a solution to fix this. Since this library is based on the RabbitMQ, using the same solution fixes the issue (I changed the code and fixed the bug in my own project)
@hi-rad Great! Would you be able the share the fix with us?
@petermein I opened a pull request