-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Messenger] Document DSN format for Redis Cluster #14956
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
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
BackEndTea
approved these changes
Feb 12, 2021
OskarStark
approved these changes
Feb 12, 2021
nicolas-grekas
added a commit
to symfony/symfony
that referenced
this pull request
Apr 13, 2021
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [Messenger] Support Redis Cluster | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38264 | License | MIT | Doc PR | symfony/symfony-docs#14956 This PR brings support for Redis Cluster in the Messenger component: - The first commit _Support RedisCluster instance_ allows to pass a `RedisCluster` object when instanciating the `Connection` class, which brings support for Redis Cluster without any friction. - The second commit _Support multiple hosts DSN for Redis Cluster_ is more opiniated and brings a DSN format to configure a Redis Cluster from `config/packages/messenger.yaml`. Instanciating `Connection` with a `RedisCluster` object: ```php $redis = new \RedisCluster(null, ['host-01:6379', 'host-02:6379', 'host-03:6379', 'host-04:6379']); $connection = new Connection([], [], [], $redis); ``` Configuring a Redis Cluster from YAML: ```yaml // config/packages/messenger.yaml framework: messenger: metadata: default: 'redis://host-01:6379,redis://host-02:6379,redis://host-03:6379' lazy: 'redis://host-01:6379?lazy=1,redis://host-02:6379,redis://host-03:6379' # Configuration will be `lazy = true` and `auto_setup = true` multipleConfig: 'redis://host-01:6379?lazy=1&auto_setup=false,redis://host-02:6379,redis://host-03:6379?auto_setup=true' ``` This format allows to define multiple hosts for a Redis Cluster and still contains valid URLs. Custom configuration is still supported, it can be specified on only one of the URLs in the DSN (see `lazy` above). If the user provides multiple configurations on different URLs, they are simply merged with the following code and if an option is defined multiple times then the latest takes precedence (see `multipleConfig` above). I understand the way the DSN is handled could not suit you. Please, if you close this PR only for the DSN part, just tell me and I will make a new PR with only the first commit. Commits ------- 04530fb [Messenger] Support Redis Cluster
symfony-splitter
pushed a commit
to symfony/redis-messenger
that referenced
this pull request
Apr 13, 2021
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [Messenger] Support Redis Cluster | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38264 | License | MIT | Doc PR | symfony/symfony-docs#14956 This PR brings support for Redis Cluster in the Messenger component: - The first commit _Support RedisCluster instance_ allows to pass a `RedisCluster` object when instanciating the `Connection` class, which brings support for Redis Cluster without any friction. - The second commit _Support multiple hosts DSN for Redis Cluster_ is more opiniated and brings a DSN format to configure a Redis Cluster from `config/packages/messenger.yaml`. Instanciating `Connection` with a `RedisCluster` object: ```php $redis = new \RedisCluster(null, ['host-01:6379', 'host-02:6379', 'host-03:6379', 'host-04:6379']); $connection = new Connection([], [], [], $redis); ``` Configuring a Redis Cluster from YAML: ```yaml // config/packages/messenger.yaml framework: messenger: metadata: default: 'redis://host-01:6379,redis://host-02:6379,redis://host-03:6379' lazy: 'redis://host-01:6379?lazy=1,redis://host-02:6379,redis://host-03:6379' # Configuration will be `lazy = true` and `auto_setup = true` multipleConfig: 'redis://host-01:6379?lazy=1&auto_setup=false,redis://host-02:6379,redis://host-03:6379?auto_setup=true' ``` This format allows to define multiple hosts for a Redis Cluster and still contains valid URLs. Custom configuration is still supported, it can be specified on only one of the URLs in the DSN (see `lazy` above). If the user provides multiple configurations on different URLs, they are simply merged with the following code and if an option is defined multiple times then the latest takes precedence (see `multipleConfig` above). I understand the way the DSN is handled could not suit you. Please, if you close this PR only for the DSN part, just tell me and I will make a new PR with only the first commit. Commits ------- 04530fb2d7 [Messenger] Support Redis Cluster
Thank you @nesk. |
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.
Document Redis Cluster support for the Messenger component.
Related to symfony/symfony#40155