0
KeyExpirationEventMessageListenerで期限切れイベントを聞きたいのですが、例が見つかりません。春データredis - 期限切れイベントを聞きます
誰かがスプリングブートを使用して行う方法を知っています。1.4.3 & Spring Data Redis?
私は現在、この
JedisPool pool = new JedisPool(new JedisPoolConfig(), "localhost");
this.jedis = pool.getResource();
this.jedis.psubscribe(new JedisPubSub() {
@Override
public void onPMessage(String pattern, String channel, String message) {
System.out.println("onPMessage pattern " + pattern + " " + channel + " " + message);
List<Object> txResults = redisTemplate.execute(new SessionCallback<List<Object>>() {
public List<Object> execute(RedisOperations operations) throws DataAccessException {
operations.multi();
operations.opsForValue().get("val:" + message);
operations.delete("val:" + message);
return operations.exec();
}
});
System.out.println(txResults.get(0));
}
}, "[email protected]__:expired");
をやっていると私は直接Jedisの代わりに春を使用したいと思います。
よろしく