37 lines
979 B
Java
Executable File
37 lines
979 B
Java
Executable File
package net.krakatoa.proxy.redis;
|
|
|
|
import lombok.Data;
|
|
import org.redisson.Redisson;
|
|
import org.redisson.api.RedissonClient;
|
|
import org.redisson.config.Config;
|
|
|
|
@Data
|
|
public class RedisManager {
|
|
|
|
private final String connectionUri;
|
|
|
|
private Config config;
|
|
private RedissonClient redissonClient;
|
|
|
|
//private StatefulRedisConnection<String, String> connection;
|
|
//private RedisStringCommands<String, String> commands;
|
|
//private RedisKeyReactiveCommands<String, String> keyReactiveCommands;
|
|
|
|
|
|
public void connect() {
|
|
this.config = new Config();
|
|
//this.config.setCodec(new MsgPackJacksonCodec());
|
|
this.config.useSingleServer().setAddress(this.connectionUri);
|
|
|
|
this.redissonClient = Redisson.create(this.config);
|
|
|
|
//this.connection = client.connect();
|
|
//this.commands = connection.sync();
|
|
//this.keyReactiveCommands = this.connection.reactive();
|
|
}
|
|
|
|
public void close() {
|
|
this.redissonClient.shutdown();
|
|
}
|
|
}
|
|
// RedisKeyReactiveCommands
|