0

I am using Redisson for Redis. I have installed Redis on my local system. I've written the following code and ran it:

Config config = new Config();
config.useSingleServer()
        .setAddress("redis://127.0.0.1:6379");

RedissonClient client = Redisson.create(config);

RMap<String, RList<String>> settings = client.getMap("settings");

RList<String> options1 = client.getList("settings_server1_option");

options1.add("Hello");
options1.add("World");
settings.put("server1", options1);

RList<String> options2 = client.getList("settings_server2_option");
options2.add("My land");
options2.add("Your land");
settings.put("server2", options2);

RList<String> options2Value = settings.get("server2");
System.out.println(options2Value);

I get the value that is expected, however, when I go into redis-cli and try to retrieve that key, I get nil why is that? Why is it not pushing the data into Redis?

user2896120
  • 3,180
  • 4
  • 40
  • 100

1 Answers1

0

You can just connect to redis-cli and run monitor command and then execute your code. If yuou are connected to the correct redis server, the command will be shown on redis-cli. If it doesn't appear then probably you are connected to the wrong server.

You can run client list on redis-cli to see number of connected clients and their address.