2017-12-18 21 views
0

우리는 Jedis.expire 이벤트를 구현했으며 KeyExpiredListener 클래스의 onPMessage 메소드로 catch하는 경향이 있습니다.Jedis pubsub >> "confis 파일에서"redis-cli config set notify-keyspace-events Ex "가 작동하지 않습니다.

 KeyExpiredListener extends JedisPubSub { 
...... 
public void onPMessage(String pattern, String channel, String message) {....} 
.... 
} 

우리는 국지적가 레디 스 CLI에 알림 이벤트를 설정할 때 그것은 완벽하게 작동합니다.

redis-cli config set notify-keyspace-events Ex 

그러나 예상대로 우리가 레디 스 서버를 다시 시작하는 경우, 이벤트 리스너가 설정과 동일 어떤 이벤트를 잡기 없습니다, 다시 기본값으로 전환

.
redis-cli config set notify-keyspace-events "" 

그래서 우리는 redis.conf 파일에서 설정하려고하지만 어떤 이벤트를 잡기 없습니다 즉 작동하지 않습니다. 우리가 CLI

config set notify-keyspace-events Ex 

작동에 설정 한 경우

요약하면, 우리는 conf의 파일 (redis.conf)에 설정하면

notify-keyspace-events Ex 

작동하지 않습니다.

감사합니다. conf의 디렉토리를 사용하여

답변

1

시작 레디 스 -

./redis-server <path of redis.conf> & 

이제 (통지 - 키 스페이스 - 이벤트 예) redis.conf에서 언급 된 작동합니다.