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

Provide a way for verticles to reload configuration upon changes #2606

Closed
cut-to-the-cheese opened this issue Aug 30, 2018 · 5 comments
Closed

Comments

@cut-to-the-cheese
Copy link

As per documentation for config retriever listening for changes, the retriever reloads the configuration every 5 seconds. Issue is that there is no way provide that new configuration to the verticle without first undeploying and redeploying it with the new configuration or doing a app/pod restart. The reason for that is the config JsonObject that holds the configuration for the verticle is created via new constructor and there is no reference to this config object available. This functionality will be really helpful where API keys and certs are being rotated out and live traffic is being taken by the app.

@vietj
Copy link
Member

vietj commented Aug 30, 2018

can you provide an example of how this would ideally be achieved ?

@cescoffier
Copy link
Contributor

I have recently extended the documentation to explain how the new configuration can be sent on the event bus and so let individual verticles "apply" the new configuration (section Propagating configuration changes to the event bus in the doc). I strongly recommend using the event bus to notify the interested verticles with the new configuration. Then, each verticle is on its own and do what's need to be done.

Notice that dynamically applying a new configuration may introduce downtime. For instance, changing the HTTP port of a server requires stopping the first one and restarting it.

@vietj
Copy link
Member

vietj commented Aug 31, 2018

thanks for the explanation @cescoffier

@vietj vietj closed this as completed Aug 31, 2018
@cut-to-the-cheese
Copy link
Author

Hi thank you for quick responses. I am unable to find Propagating configuration changes to the event bus anywhere. Can you please link to that? Thank you

@rodolfodpk
Copy link

rodolfodpk commented Apr 2, 2019

While I understand using ConfigRetriever.listen can be used to propagate config changes to many verticles and other components (and it is probably the right way), it would be nice to inform the ConfigRetriever to simply relaunch the main verticle / full application. I usually have this in my main verticle:
public static void main(String[] args) { Launcher.executeCommand("run", MyMainVerticle.class.getName()); }
and I wonder if it could work. Between some downtime on config changes and a simpler immutable app model I do prefer the latter. And if it could work with native apps (Quarkus and Graal), the downtime would be almost invisible.

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

4 participants