-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Messages retried through FailedMessagesRetryCommand do not take retry mechanism into account #35449
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
Comments
I found this issue which explains the reason why that is: #33685 I still would like to ask if this is really wanted behavior? |
Yes. The original transport could be full. The failure transport is for manual retries. For automatic retries the retry configuration of the orignal transport is already in effect. |
@Tobion Thanks for clarifying. Would it make sense to add that to the documentation of the failure transport? |
Hey, thanks for your report! |
Could I get a reply or should I close this? |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Symfony version(s) affected: 4.4.2 upwards and 5.0.*
Description
I noticed that despite having a retry mechanism in place for a failure transport, messages does not get retried if run by the FailureMessagesRetryCommand.
This is due to the fact that the provided maximum number of messages for the StopWorkerOnMessageLimitListener in the command is 1, which results in the listener stopping the worker after one attempted handling of the message, not taking the retry mechanism into account.
How to reproduce
This is the retry mechanism (making use of the doctrine transport):
When consuming a message in the respective handler, just throw an exception.
When running it the first time, it will get retried three times.
Then, run
php bin/console messenger:failed:retry -vv
.You will notice it just runs once before the worker is stopped.
Additional context
See the following code fragments:
Symfony\Component\Messenger\Command\FailedMessagesRetryCommand
Symfony\Component\Messenger\EventListener\StopWorkerOnMessageLimitListener
Symfony\Component\Messenger\Worker
The text was updated successfully, but these errors were encountered: