-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
messenger: add multiple transports support documentation #13489
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
Closed
monteiro
wants to merge
3
commits into
symfony:master
from
monteiro:messenger-multiple-failed-transports
Closed
messenger: add multiple transports support documentation #13489
monteiro
wants to merge
3
commits into
symfony:master
from
monteiro:messenger-multiple-failed-transports
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
4 tasks
This PR has been closed because the master has been removed. |
chalasr
added a commit
to symfony/symfony
that referenced
this pull request
Mar 30, 2021
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- Messenger multiple failed transports | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #34911 | License | MIT | Doc PR | symfony/symfony-docs#13489 <!-- symfony/symfony-docs#13489 Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> ## Strategy applied - Pass a map of transports and failed transports to the `SendFailedMessageToFailureTransportListener`. This way we re-use the same listener. - Local failed transport has more priority than a global failed transport defined. ## Configuration example ```yaml # config/packages/messenger.yaml framework: # no need to set failed transport globally if I want a specific behaviour per transport. failure_transport: failed # all transports have this failed transport messenger: transports: failed: 'doctrine://default?queue_name=failed' failed_important: 'doctrine://default?queue_name=failed_important' async: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' failure_transport: failed # takes precedence over the global defined "failed_transport" retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 async_no_failure_transport: # it will use the global defined transport if no one is defined. dsn: '%env(MESSENGER_TRANSPORT_DSN)%' retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 async_send_specific_failure_queue: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' failed_transport: failed_important # takes precedence over the global defined "failed_transport" retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 ``` You can test this feature easily on a [demo project](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). Just follow the [README](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). **More information on issue #34911** ## What needs to be done so this can be merged: - [x] validate strategy - [ ] update src/**/CHANGELOG.md files - [x] update tests to cover all cases - [x] create doc PR Commits ------- 5810b6c Messenger multiple failed transports
symfony-splitter
pushed a commit
to symfony/framework-bundle
that referenced
this pull request
Mar 30, 2021
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- Messenger multiple failed transports | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #34911 | License | MIT | Doc PR | symfony/symfony-docs#13489 <!-- symfony/symfony-docs#13489 Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/roadmap): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch master. --> ## Strategy applied - Pass a map of transports and failed transports to the `SendFailedMessageToFailureTransportListener`. This way we re-use the same listener. - Local failed transport has more priority than a global failed transport defined. ## Configuration example ```yaml # config/packages/messenger.yaml framework: # no need to set failed transport globally if I want a specific behaviour per transport. failure_transport: failed # all transports have this failed transport messenger: transports: failed: 'doctrine://default?queue_name=failed' failed_important: 'doctrine://default?queue_name=failed_important' async: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' failure_transport: failed # takes precedence over the global defined "failed_transport" retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 async_no_failure_transport: # it will use the global defined transport if no one is defined. dsn: '%env(MESSENGER_TRANSPORT_DSN)%' retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 async_send_specific_failure_queue: dsn: '%env(MESSENGER_TRANSPORT_DSN)%' failed_transport: failed_important # takes precedence over the global defined "failed_transport" retry_strategy: max_retries: 3 delay: 1000 multiplier: 2 ``` You can test this feature easily on a [demo project](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). Just follow the [README](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). **More information on issue #34911** ## What needs to be done so this can be merged: - [x] validate strategy - [ ] update src/**/CHANGELOG.md files - [x] update tests to cover all cases - [x] create doc PR Commits ------- 5810b6c378 Messenger multiple failed transports
@monteiro Any chance you can resubmit on the main branch? Or create an issue to keep track of this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Feature: Messenger: Multiple Failed Transports
This PR adds the documentation related to PR: symfony/symfony#34979
What it needs to be clear in the documentation:
failed_transport
configured the messages will be discardedfailure_transport
configuration, the one taken into account is at the transport level configuration.failed_transport
. Without arguments is the global failed transport taken into account.