0

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 ?

ses
  • 13,174
  • 31
  • 123
  • 226
  • well I see now why: https://github.com/vert-x3/vertx-config/blob/master/vertx-config-redis/src/main/java/io/vertx/config/redis/RedisConfigStore.java – ses Nov 19 '17 at 23:09
  • hgetall my-microservice-config (error) WRONGTYPE Operation against a key holding the wrong kind of value. I can not say it is nice though. I would love to get my json as I set it. – ses Nov 19 '17 at 23:15

0 Answers0