ConfigStoreOptions serverStore = new ConfigStoreOptions().setType("file")
.setFormat("yaml")
.setConfig(new JsonObject().put("path",
"server.config.yaml"));
ConfigRetrieverOptions retrieverOptions = new ConfigRetrieverOptions().setScanPeriod(2000)
.addStore(serverStore);
ConfigRetriever retriever = ConfigRetriever.create(vertx, retrieverOptions);
.....
....
retriever.listen(change -> {
// Previous configuration
JsonObject previous = change.getPreviousConfiguration();
System.out.println("old config" + previous);
// New configuration
config = change.getNewConfiguration();
System.out.println("new config" + config);
stopServer();
opt.setIdleTimeout(config.getJsonObject("tcpserver")
.getInteger("idleConnectionTimeout", 500));
startServer(opt);
});
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/1404cb8e-2d0f-4679-aba6-4cb66a67ef37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-chhil