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

Allow configuring of the Vertx instance itself #24

Closed
informedgut opened this issue Oct 25, 2017 · 3 comments
Closed

Allow configuring of the Vertx instance itself #24

informedgut opened this issue Oct 25, 2017 · 3 comments
Assignees
Milestone

Comments

@informedgut
Copy link

informedgut commented Oct 25, 2017

I don't know how you'd pull this off since Vertx Config requires a Vertx Instance, hence the chicken-or-egg situation. What I've done as a workaround is have an initial ConfigRetriever that uses a temp Vertx instance. It does the initial retrieve and then I configure Vertx using the properties from there. Then, I close the ConfigRetriever and create a new one that uses the new and configured Vertx instance. It's the one used for subsequent retrievals, both manual and auto-scans.

Thanks and good luck. :)

(This is a follow-up to #23.)

@cazacugmihai
Copy link
Contributor

You can extend Launcher, load the configuration (e.g.: a yaml config file) and inject it into Vertx configuration but it looks more like a hack. It would be nice to have this behavior supported by the Vertx itself.

@InfoSec812
Copy link

@cazacugmihai Except to use the ConfigRetriever you need an instance of Vertx. For the methods in Launcher where the Vertx instance is available, there is no way to set the config directly. You would have to use something like:

vertx.getOrCreateContext().config().mergeIn(newConfig);

But that COULD be problematic depending on how you are starting/configuring your application.

@cescoffier cescoffier self-assigned this Aug 6, 2018
@cescoffier cescoffier added this to the 3.6.0 milestone Aug 6, 2018
@cescoffier
Copy link
Member

The configuration has been updated with an example.

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

No branches or pull requests

4 participants