@Autowired RedisTemplate <文字列、文字列> redisTemplate。 redisTemplate.execute(新しい SessionCallback <OBJECT> (){ @Override 公共 <K、V>オブジェクトの実行(RedisOperations <K、V>操作)がスローDataAccessException { // 开启事务 ; operations.multiを() のための(int型 I = 1 ; iが5 = <; iは++ ){ redisTemplate.convertAndSend( "号我是消息{%のD}:%TT" "チャネル試験"、String.Formatの(I、新しい日付())); redisTemplate.opsForValueを( )。セット("キー" + I、 "キー" + Iを); } // トランザクションを実行 operations.execを(); 戻り値 はnull ; } });