8000 [Messenger] Add the `--all` option to the `messenger:failed:remove` command by alexandre-daubois · Pull Request #51593 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Add the --all option to the messenger:failed:remove command #51593

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

Conversation

alexandre-daubois
Copy link
Member
@alexandre-daubois alexandre-daubois commented Sep 7, 2023
Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR Todo

We have a development server (which we don't have direct access to the database). As this server serves as a test for our devs, error messages can accumulate in our failure transport. We wanted to use the messenger:failed:remove command to remove them, but unfortunately, we must provide ids individually. This is problematic as we have several hundreds of failed messages.

This PR adds the --all option to the command. This option must be used with the --force option (juste like doctrine:schema:update --force actually) to work. Example output:

$ bin/console messenger:failed:remove --all --force

...

Failed Message Details
======================
                                                                                                                        
 [WARNING] Message does not appear to have been sent to this transport after failing                                    
                                                                                                                        
 ------------ ------------------------- 
  Class        App\Message\YourMessage  
  Message Id   6                        
 ------------ ------------------------- 

 ! [NOTE] 4 messages were removed.                                                                                      

As you can see, you can of course still use the --show-messages option jointly.

@alexandre-daubois
Copy link
Member Author

All comments addressed, thanks! 🙂

@alexandre-daubois
Copy link
Member Author

Addressed all your comments Nicolas, thank you!

@alexandre-daubois alexandre-daubois force-pushed the remove-all-failed-msgs branch 2 times, most recently from f26d36b to b674207 Compare September 19, 2023 14:08
@alexandre-daubois alexandre-daubois force-pushed the remove-all-failed-msgs branch 2 times, most recently from 7d62d21 to 322d892 Compare September 21, 2023 06:57
@nicolas-grekas
Copy link
Member

Thank you @alexandre-daubois.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0