Skip to content

fix: do not reset attemps header when message is requeue #1301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2023

Conversation

eortiz-tracktik
Copy link
Contributor

This change will allow to use $message->getAttempts() when true === $message->isRedelivered() to find how many times this message has been requeue/redelivered. Such information is useful to decide if the message should be requeue to retry again later or rejected to be completely removed from the queue in case of error.

Something similar was asked on #940 but the suggestion on #940 (comment) is about adding another header with a similar purpose than attempts.

On \Enqueue\Redis\RedisConsumerHelperTrait::processResult() we already increment attempts header, so if we don't reset it when the message is requeue we will have the accurate information about how many times the message has been consumed.

@eortiz-tracktik eortiz-tracktik force-pushed the issue-940 branch 2 times, most recently from b17b356 to 27f8b69 Compare May 20, 2023 04:59
@eortiz-tracktik
Copy link
Contributor Author

Hello @makasim and @ASKozienko
Could you take a look at this proposition?
Thanks a lot.

@eortiz-tracktik eortiz-tracktik requested a review from makasim May 20, 2023 16:19
@makasim makasim merged commit 4a78c2e into php-enqueue:master May 20, 2023
@eortiz-tracktik eortiz-tracktik deleted the issue-940 branch May 20, 2023 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants