Skip to content
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

Dynamically update redis client properties #1430

Closed
siddharthgoel88 opened this issue Aug 3, 2020 · 3 comments
Closed

Dynamically update redis client properties #1430

siddharthgoel88 opened this issue Aug 3, 2020 · 3 comments

Comments

@siddharthgoel88
Copy link

In an application once we have initialised redis client with various Options parameters, what is the most viable and elegant way to update those properties? Currently, I am looking for connection-pool resizing but in general it would be very helpful (as well as interesting) to know what is the correct way to update the redis-client without application restart.

@siddharthgoel88 siddharthgoel88 changed the title Dynamically update client properties Dynamically update redis client properties Aug 3, 2020
@danielkurniadi
Copy link

👍 I also wonder if we can update redis client properties on the fly. Yes I'm aware we can just override redisClient.Opts.Addr = "10.231.25.1:3009" on the fly but I wonder if this will take effect in the run time.

My situation is I want to add a service discovery for redis. Such that when the broker address changed, my web app get updated with the new address.

@danielkurniadi
Copy link

@vmihailenco Can you Help on this. Thanks 🙏

@vmihailenco
Copy link
Collaborator

This is not supported and unlikely to be implemented (lots of work and not a popular feature). If you really need this you could store *redis.Client in atomic.Pointer and replace it when config changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants