In redis-cli:
127.0.0.1:6379> get my-microservice-config
"{\n "http.port": 35001\n}\n"
(the way I set it is from the bash-script: redis-cli -x set my-config < my-microservice-config.json
) where the my-microservice-config.json hold the json configuration.
In the code where I use vertx-config
:
final ConfigStoreOptions redisSore = new ConfigStoreOptions()
.setType("redis")
.setConfig(new JsonObject()
.put("host", "localhost")
.put("port", 6379)
.put("key", "my-microservice-config")
);
final ConfigRetriever retriever = ConfigRetriever.create(vertx, options);
retriever.getConfig( ar -> {
if ( ar.failed()) {
System.out.println("Failed to retrieve the configuration");
...
got error:
WRONGTYPE Operation against a key holding the wrong kind of value
checking the type of the value: it looks pretty much like string type
127.0.0.1:6379> type my-microservice-config
string
but anyways.. the question is: how to retrieve the config value that I see in cli when I do get ?