-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Do not return fallback senders when other senders were already found #48121
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
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
chalasr
approved these changes
Nov 5, 2022
src/Symfony/Component/Messenger/Tests/Transport/Sender/SendersLocatorTest.php
Outdated
Show resolved
Hide resolved
maxbeckers
approved these changes
Nov 11, 2022
As this is a behavior change, I would suggest merging it into 6.3 instead. |
a464b31
to
cd43ccd
Compare
nicolas-grekas
approved these changes
Dec 16, 2022
src/Symfony/Component/Messenger/Transport/Sender/SendersLocator.php
Outdated
Show resolved
Hide resolved
cd43ccd
to
acae5ca
Compare
Thank you @wouterj. |
Merged
nicolas-grekas
added a commit
that referenced
this pull request
Sep 29, 2023
…altzu) This PR was merged into the 6.3 branch. Discussion ---------- [Messenger] Fix routing to multiple fallback transports | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT The change made in #48121 means that it's not possible to route into multiple transport as fallback like ```yaml framework: messenger: routing: My\Message\*: [async, audit] ``` F.e. the message `My\Message\ToBeSentToTwoSenders` would only reach `async`. The comment in the code mentions > if other senders already matched **with previous types**, skip the senders bound to the fallback While in reality how it works is > if other senders already matched, skip the senders bound to the fallback After the changes in this MR it works as mentioned in the original comment, meaning it does not skip for the same type, but routes to all transports for that type. --- This is not a BC break because anyone who has more than one transport in a wildcard rule has never received anything matching the wildcard on other than the 1st transport – so only if you had a misconfiguration in the first place you're affected. Commits ------- 76f2433 Fix routing to multiple fallback transports
symfony-splitter
pushed a commit
to symfony/messenger
that referenced
this pull request
Sep 29, 2023
…altzu) This PR was merged into the 6.3 branch. Discussion ---------- [Messenger] Fix routing to multiple fallback transports | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | License | MIT The change made in symfony/symfony#48121 means that it's not possible to route into multiple transport as fallback like ```yaml framework: messenger: routing: My\Message\*: [async, audit] ``` F.e. the message `My\Message\ToBeSentToTwoSenders` would only reach `async`. The comment in the code mentions > if other senders already matched **with previous types**, skip the senders bound to the fallback While in reality how it works is > if other senders already matched, skip the senders bound to the fallback After the changes in this MR it works as mentioned in the original comment, meaning it does not skip for the same type, but routes to all transports for that type. --- This is not a BC break because anyone who has more than one transport in a wildcard rule has never received anything matching the wildcard on other than the 1st transport – so only if you had a misconfiguration in the first place you're affected. Commits ------- 76f2433fa9 Fix routing to multiple fallback transports
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.
See https://github.com/wouterj/sf-reproducer/tree/messenger-star-routing for a reproducer of the current situation.
Currently, if you use the special
*
in the Messenger's routing configuration, this sender is always returned for all messages (also for messages explicitly configured to use another sender). According to the documentation, the star should act as a fallback instead: