How to read data from property files? I understand vertx uses '.json' files for storing data but not sure how to create JsonObject from property/config file.
I would like to keep, server port, connection url, db name etc. in to a config file.
String jsonStr = IOUtils. toString(new FileReader(myFileName)); JsonObject jsonObj = new JsonObject(jsonStr);
public interface ConfigRetriever. Defines a configuration retriever that read configuration from ConfigStore and tracks changes periodically. Author: Clement Escoffier.
The application is started; open your browser to http://localhost:8080 and you should see the Hello message. If you change the message in the code and save the file, the application is restarted with the updated message. Hit CTRL+C to stop the application. That's all for the application.
Vert. x is a toolkit, not a framework, so it is naturally very composable and embeddable. We have no strong opinion on what your application structure should be like. Select the modules and clients you need and compose them as you craft your application.
you should run your verticle over io.vertx.core.Launcher
, then you could add conf option -conf config.panser.json
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With