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] Add a redis stream transport#30917
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
e355a4e to62b159cComparecurry684 commentedApr 6, 2019
Needs |
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/Fixtures/long_receiver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Tests/Transport/RedisExt/RedisExtIntegrationTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
62b159c toe0d5932Comparesrc/Symfony/Component/Messenger/Tests/Transport/RedisExt/ConnectionTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
781ae29 to580fdb9Comparecba457c to52d3d68Compare
chalasr left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Thanks for this, I want it for 4.3 :)
The framework integration is missing, we need to register the redis transport factory in FrameworkBundle's messenger.xml (and add a test for it)
src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
97af470 toa4cceeeComparea4cceee to4461d36Comparealexander-schranz commentedApr 24, 2019
@chalasr thank you for your review. did fix it and register the factory in the framework bundle. |
src/Symfony/Component/Messenger/Transport/RedisExt/RedisSender.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
chalasr commentedApr 25, 2019
Adding a test in symfony/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php Line 680 ina7d2019
|
d0b63af to4ed23bdCompare4ed23bd toff0b855Compare
chalasr left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Tried this on a real project (will allow me to drop enqueue/messenger-adapter 🎉 ), works just fine.
I think implementingMessageCountAwareInterface can be done later, not a blocker.
fabpot commentedApr 27, 2019
Thank you@alexander-schranz. |
…ander-schranz)This PR was merged into the 4.3-dev branch.Discussion----------[Messenger] Add a redis stream transport| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | Yes| Fixed tickets |#28681| License | MIT| Doc PR |symfony/symfony-docs#11341As discussed in#28681 this will refractor@soyuka implementation of redis using the redis stream features so we don't need to handle parking the messages ourself and redis is doing it for us.Some interesting links about streams: -https://redis.io/topics/streams-intro -https://brandur.org/redis-streams```+-----------R| GET | -> XREADGROUP+-----------+ | | handleMessage V+-----------+ No| failed? |---------------------------++-----------+ | | | | Yes | V |+-----------+ No || retry? |---------------------------++-----------+ | | | | Yes | V V+-----------R +-----------R| REJECT | -> XDEL | ACK | -> XACK+-----------+ +-----------+```**GET**: Will use `XREADGROUP` to read the one message from the stream**REJECT**: Reject will just remove the message with `XDEL` from the stream as adding it back to the stream is handled by symfony worker itself**ACK**: Will use the `XACK` Method to ack the message for the specific groupThe sender will still be simple by calling the `XADD` redis function.#EU-FOSSACommits-------ff0b855 Refractor redis transport using redis streams7162d2e Implement redis transport
soyuka commentedApr 28, 2019
Nice work thanks@alexander-schranz ! |
alexander-schranz commentedApr 29, 2019
@soyuka thank you for initial work! |
…chranz)This PR was submitted for the master branch but it was squashed and merged into the 4.3 branch instead (closes#11341).Discussion----------Add documentation for the Redis transportThis will add documentation how to configure and using the redis transport with the messenger component.symfony/symfony#30917#EUFOSSACommits-------c22fade Add documentation for the Redis transport
Uh oh!
There was an error while loading.Please reload this page.
As discussed in#28681 this will refractor@soyuka implementation of redis using the redis stream features so we don't need to handle parking the messages ourself and redis is doing it for us.
Some interesting links about streams:
GET: Will use
XREADGROUPto read the one message from the streamREJECT: Reject will just remove the message with
XDELfrom the stream as adding it back to the stream is handled by symfony worker itselfACK: Will use the
XACKMethod to ack the message for the specific groupThe sender will still be simple by calling the
XADDredis function.#EU-FOSSA