Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias#34185
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
72f2480 to3a2672fCompare| useSymfony\Component\Messenger\Transport\Sender\SendersLocator; | ||
| useSymfony\Component\Messenger\Worker; | ||
| class RetryIntegrationTestextends TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
fully covered by FailureIntegrationTest
3a2672f to4b5547aCompare
weaverryan left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Absolutely wonderful.
This removes some "evil" (added by me 👿) without any downside that I can see. It's simply a cleaner implementation - moving several "special cases" like theRedeliveryStamp handling - out of core classes likeWorker andSendMessageMiddleware and into event listeners.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/EventListener/SendFailedMessageToFailureTransportListener.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/EventListener/SendFailedMessageForRetryListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Command/AbstractFailedMessagesCommand.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
4b5547a to71a18acCompareand failure directly to transport instead of redispatching on the bus
71a18ac tod7e0f98Compare
weaverryan left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
+1
Test failures match failures on current 4.4 or things that should resolve after merge afaik (like FWBundle from this PR failing against symfony/messenger:dev-master due to a class added in this PR missing).
…id of SendersLocatorInterface::getSenderByAlias (Tobion)This PR was merged into the 4.4 branch.Discussion----------[Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tickets |Fix#32077 and#31848| License | MIT| Doc PR |as discussed with@weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleanerCommits-------d7e0f98 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
nikic commentedNov 4, 2019
The test |
Tobion commentedNov 4, 2019
It's getting fixed in#34217 |
This PR was merged into the 7.4 branch.Discussion----------[Messenger] Simplify code| Q | A| ------------- | ---| Branch? | 7.4| Bug fix? | no| New feature? | no| Deprecations? | no| Issues | -| License | MITNoticed while working on#61843.There's no reason for the event to be dispatched inside the loop anymore:1. The event was [originally dispatched outside the loop](#30650).2. It was later [moved inside the loop](#30676) because of the retry mechanism.3. [The retry mechanism was later extracted](#34185), so there's no longer a need for the event to be dispatched inside the loop.Commits-------beeb4b9 [Messenger] Simplify code
Uh oh!
There was an error while loading.Please reload this page.
as discussed with@weaverryan sending messages for retry and failure directly to transport instead of redispatching on the bus makes things much cleaner