I am using Jedis 2.9.0 version and i followed
Redis Key expire notification with Jedis
but onPMessage method in Listener is not called when redis key expires.
in Subscriber I used
jedis.psubscribe(new KeyExpiredListener(), "*");
When I am running server
jedis.set("notify", "test");
jedis.expire("notify", 10);
but After 10 seconds Redis key expired but onPMessage did not trigger.
Expire keyspace notification isn't fired just when a key has expired but (taken from the docs):
In addition, maybe you've not enabled keyspace notifications:
Some docs page will explain you how to enable them.