title: Spring data redis - listen to expiration event
body: <p>I would like to listen expiration events with KeyExpirationEventMessageListener but I can't find an example.</p>
  
  <p>Someone know how to do it using Spring boot 1.4.3 &amp; Spring Data Redis?</p>
  
  <p>I am currently doing this </p>
  
  <pre><code>    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&lt;Object&gt; txResults = redisTemplate.execute(new SessionCallback&lt;List&lt;Object&gt;&gt;() {
                  public List&lt;Object&gt; 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));
          }
      }, "__keyevent@0__:expired");
  </code></pre>
  
  <p>And I would like to use Spring instead of Jedis directly.</p>
  
  <p>Regards</p>