Redisson uses high-perfomance async and lock-free Java client for Redis or Valkey. It supports both async and sync modes. The most popular use case is to execute a command not supported by Redisson yet. Please make sure that required command is not supported already with Redis or Valkey command mapping list. org.redisson.client.protocol.RedisCommands - contains all available commands. Code example:
// Use shared EventLoopGroup only if multiple clients are usedEventLoopGroup group = new NioEventLoopGroup();RedisClientConfig config = new RedisClientConfig();config.setAddress("redis://localhost:6379") // or rediss:// for ssl connection.setPassword("myPassword").setDatabase(0).setClientName("myClient").setGroup(group);RedisClient client = RedisClient.create(config);RedisConnection conn = client.connect();//orCompletionStage<RedisConnection> connFuture = client.connectAsync();// execute SET command in sync wayconn.sync(StringCodec.INSTANCE, RedisCommands.SET, "test", 0);// execute GET command in async wayconn.async(StringCodec.INSTANCE, RedisCommands.GET, "test");conn.close()// orconn.closeAsync()client.shutdown();// orclient.shutdownAsync();
