Skip to content

[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Oct 30, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
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 cleaner

@Tobion Tobion requested a review from sroze as a code owner October 30, 2019 11:20
@Tobion Tobion added this to the 4.4 milestone Oct 30, 2019
@Tobion Tobion force-pushed the messenger-refactoring branch 5 times, most recently from 72f2480 to 3a2672f Compare October 31, 2019 12:51
@Tobion Tobion changed the title [Messenger] WIP: refactoring [Messenger] extract worker logic to listener and get rid of SendersLocatorInterface::getSenderByAlias Oct 31, 2019
use Symfony\Component\Messenger\Transport\Sender\SendersLocator;
use Symfony\Component\Messenger\Worker;

class RetryIntegrationTest extends TestCase
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fully covered by FailureIntegrationTest

@Tobion Tobion force-pushed the messenger-refactoring branch from 3a2672f to 4b5547a Compare October 31, 2019 13:21
Copy link
Member

@weaverryan weaverryan left a 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 the RedeliveryStamp handling - out of core classes like Worker and SendMessageMiddleware and into event listeners.

@Tobion Tobion force-pushed the messenger-refactoring branch from 4b5547a to 71a18ac Compare October 31, 2019 14:21
and failure directly to transport instead of redispatching on the bus
Copy link
Member

@weaverryan weaverryan left a 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).

Tobion added a commit that referenced this pull request Nov 1, 2019
…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 cleaner

Commits
-------

d7e0f98 [Messenger] extract worker logic to listener and sent messages for retry and failure directly to transport instead of redispatching on the bus
@Tobion Tobion merged commit d7e0f98 into symfony:4.4 Nov 1, 2019
@Tobion Tobion deleted the messenger-refactoring branch November 1, 2019 23:49
@nikic
Copy link
Contributor

nikic commented Nov 4, 2019

The test Symfony\Component\Messenger\Tests\FailureIntegrationTest::testRequeMechanism hangs locally after this change.

@Tobion
Copy link
Contributor Author

Tobion commented Nov 4, 2019

It's getting fixed in #34217

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.

[Messenger] refactoring to get rid of SendersLocatorInterface::getSenderByAlias
4 participants