stringRedisTemplate.setEnableTransactionSupport(true);//redis session支持事物
stringRedisTemplate.multi();//开始事物
stringRedisTemplate.opsForValue().set("key1", "value1", Duration.ofDays(1L));
stringRedisTemplate.opsForValue().set("key2", "value2", Duration.ofDays(1L));
stringRedisTemplate.opsForValue().set("key3", "value3", Duration.ofDays(1L));
String string1 = stringRedisTemplate.opsForValue().get("key1");
String string2 = stringRedisTemplate.opsForValue().get("key2");
String string3 = stringRedisTemplate.opsForValue().get("key3");
log.info("string1={},string2={},string3={}", string1, string2, string3);//string1=null,string2=null,string3=null
List<Object> list = stringRedisTemplate.exec();//提交事物list=[true, true, true, value1, value2, value3]
log.info("list={}", list);