2017-12-18 296 views
0

我們實現了Jedis.expire事件,並傾向於使用KeyExpiredListener類的onPMessage方法來捕獲。Jedis pubsub >>「redis-cli config set notify-keyspace-events Ex」不能從conf文件中工作

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

它完美 當我們設置.the在Redis的CLI通知事件。

redis-cli config set notify-keyspace-events Ex 

但不如預期,如果我們重啓Redis的服務器,事件偵聽器切換回默認情況下,捕捉任何情況下,這是相同的設置。

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 -

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

現在(通知-密鑰空間事件例)將致力於其在redis.conf提及。

相關問題