-
Notifications
You must be signed in to change notification settings - Fork 206
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
113 Add support for Redis clusters #148
Conversation
fix using {} to replace [] - untested
add queue_cluster_test.go welle: Remove hardcoded connection options.
Add new function OpenConnectionWithOptions() for the new approach.
Rename RedisSingleWrapper back to RedisWrapper
To allow opening RMQ connections which use the Redis hash tags {} instead of []. This is required to make rmq work with Redis clusters. This commit also reverts the behavior of all other OpenConnection[...] functions to behave as before by still using [] instead of {}. This switch is done by using different Redis key templates. For example instead of rmq::connection::{connection}::queue::[{queue}]::consumers we would use rmq::connection::{connection}::queue::{{queue}}::consumers when using OpenClusterConnection()
Lines Of Code
|
Go API Changes# github.com/adjust/rmq/v5 ## compatible changes OpenClusterConnection: added OpenConnectionWithRedisOptions: added # summary Inferred base version: v5.1.3 Suggested version: v5.2.0 |
Benchmark ResultBenchmark diff with base branch
Benchmark result
|
445ae71
to
e8454e6
Compare
Unit Test Coveragetotal: (statements) 71.4% Coverage of changed lines
Coverage diff with base branch
|
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.
I've updated CI setup to use the mentioned create-cluster
script instead of a dockerized service.
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.
LGTM, thanks!
Close #113.
This PR adds support for using rmq with a Redis cluster by allowing to use the Redis hash tags
{}
instead of the characters[]
we used before. We used[]
before to allow having certain keys live on the same Redis node using nutcracker, in the same way{}
is now used by Redis cluster.This is a continuation of #128. I took the original commits (with slight modifications) and then added a few more to:
OpenConnection()
functions, make sure their behavior doesn't change compared to master.OpenClusterConnection()
function which uses the different Redis hash keys{}
instead of[]
.Note: I managed to run the tests locally by following https://github.com/redis/redis/tree/unstable/utils/create-cluster and then running the tests like this:
But in the current state they are not easy to run locally (you need a Redis cluster) and I expect them to fail in CI too. We should try to improve/fix that. Maybe there's a way to set up a working Redis cluster with
miniredis
(which is already used in some tests)?