org.springframework.boot
spring-boot-starter-data-redis
org.redisson
redisson
3.7.4
————————————————
redis
spring.redis.host=XXX.XXX.XX.XX(host地址)
spring.redis.password=password(密码)
spring.redis.port=6060(端口号)
spring.redis.database=0
spring.redis.timeout=10000
————————————————
public void setFamilyBo() {
//从redis里存值 ,RBucket 普通的管道
FamilyBo familyBo = new FamilyBo("jingliyuan",0,26);
RBucket serRBucket = redissonClient.getBucket("Family");
serRBucket .set(familyBo);
//从redis里取值
RBucket getRBucket = redissonClient.getBucket("Family");
FamilyBo result = getRBucket .get();
}