-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Simplifying SyncTransport and fixing bug with handlers transport #31401
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
Conversation
The approach completely makes sense to me. When you say "it's not quite working", what's the main remaining thing to crack? 🤔 |
1cfccfb
to
3871592
Compare
d3cd5ca
to
83c0a0d
Compare
src/Symfony/Component/Messenger/Transport/Sync/SyncTransport.php
Outdated
Show resolved
Hide resolved
6479c05
to
ad655c0
Compare
ad655c0
to
8a49eb8
Compare
Tests passing - this is ready to go. |
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.
So clean 👍
With that I feel we don't need the send_and_handle
logic anymore as the sync transport does the same thing.
So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing
framework:
messenger:
routing:
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
senders: [amqp]
send_and_handle: true
is the same as
framework:
messenger:
routing:
'My\Message\ThatIsGoingToBeSentAndHandledLocally':
senders: [amqp, sync]
if I'm not mistaken.
I was thinking the same thing :). That would remove an awkward option. |
I'm looking into creating a PR. |
Thank you @weaverryan. |
…h handlers transport (weaverryan) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] Simplifying SyncTransport and fixing bug with handlers transport | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | not needed This is still a WIP, because it's not quite working and tests are a TODO. However, the basic idea is there. This makes SyncTransport less "weird". It acts more like a real transport... except that it "receives" and re-dispatches its message immediately. The bug I'm trying to fix is related to the transport-based handling config that @sroze introduced. It doesn't currently play nice with the sync transport due to the unnatural way that I made it originally. Cheers! Commits ------- 8a49eb8 Simplifying SyncTransport and fixing bug with handlers transport
…ed with SyncTransport (Tobion) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] remove send_and_handle which can be achieved with SyncTransport | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | yes <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#11236 The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759 So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp] send_and_handle: true ``` is the same as ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp, sync] ``` #31401 (review) Commits ------- 4552b7f [Messenger] remove send_and_handle option which can be achieved with SyncTransport
…ed with SyncTransport (Tobion) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] remove send_and_handle which can be achieved with SyncTransport | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | yes <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#11236 The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759 So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp] send_and_handle: true ``` is the same as ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp, sync] ``` symfony/symfony#31401 (review) Commits ------- 4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport
…ed with SyncTransport (Tobion) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] remove send_and_handle which can be achieved with SyncTransport | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | yes <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#11236 The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759 So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp] send_and_handle: true ``` is the same as ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp, sync] ``` symfony/symfony#31401 (review) Commits ------- 4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport
…ed with SyncTransport (Tobion) This PR was merged into the 4.3 branch. Discussion ---------- [Messenger] remove send_and_handle which can be achieved with SyncTransport | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | no | New feature? | yes/no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | yes <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#11236 The send_and_handle option is pretty awkward and we don't need it anymore because the same thing can be achieved with the SyncTransport from #30759 So the following example from the doc in https://symfony.com/doc/current/messenger.html#routing ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp] send_and_handle: true ``` is the same as ```yaml framework: messenger: routing: 'My\Message\ThatIsGoingToBeSentAndHandledLocally': senders: [amqp, sync] ``` symfony/symfony#31401 (review) Commits ------- 4552b7f5b2 [Messenger] remove send_and_handle option which can be achieved with SyncTransport
This is still a WIP, because it's not quite working and tests are a TODO. However, the basic idea is there. This makes SyncTransport less "weird". It acts more like a real transport... except that it "receives" and re-dispatches its message immediately.
The bug I'm trying to fix is related to the transport-based handling config that @sroze introduced. It doesn't currently play nice with the sync transport due to the unnatural way that I made it originally.
Cheers!