title: Hazelcast Map TTL not working with spring cache abstraction
body: <p>I am trying to get Hazelcast 3.0.2 working with Spring abstraction however it seems the TTL functionality is not working.</p>
  
  <p>I have configured my spring context in the following way</p>
  
  <pre><code>&lt;cache:annotation-driven cache-manager="cacheManager" mode="proxy" proxy-target-class="true" /&gt;
  &lt;bean id="cacheManager" class="com.hazelcast.spring.cache.HazelcastCacheManager"&gt;
      &lt;constructor-arg ref="hzInstance" /&gt;
  &lt;/bean&gt;
  &lt;hz:hazelcast id="hzInstance"&gt;
      &lt;hz:config&gt;
          &lt;hz:group name="instance" password="password" /&gt;
          &lt;hz:properties&gt;
              &lt;hz:property name="hazelcast.merge.first.run.delay.seconds"&gt;5&lt;/hz:property&gt;
              &lt;hz:property name="hazelcast.merge.next.run.delay.seconds"&gt;5&lt;/hz:property&gt;
              &lt;hz:property name="hazelcast.logging.type"&gt;slf4j&lt;/hz:property&gt;
              &lt;hz:property name="hazelcast.jmx"&gt;true&lt;/hz:property&gt;
              &lt;hz:property name="hazelcast.jmx.detailed"&gt;true&lt;/hz:property&gt;
          &lt;/hz:properties&gt;
          &lt;hz:network port="8995" port-auto-increment="true"&gt;
              &lt;hz:join&gt;
                  &lt;hz:tcp-ip enabled="true"&gt;
                      &lt;hz:interface&gt;10.0.5.5&lt;/hz:interface&gt;
                      &lt;hz:interface&gt;10.0.5.7&lt;/hz:interface&gt;
                  &lt;/hz:tcp-ip&gt;                           
              &lt;/hz:join&gt;
          &lt;/hz:network&gt;
          &lt;hz:map name="somecache"
                  backup-count="1"
                  max-size="0"
                  eviction-percentage="30"
                  read-backup-data="false"
                  time-to-live-seconds="120"
                  eviction-policy="NONE"
                  merge-policy="hz.ADD_NEW_ENTRY" /&gt;
      &lt;/hz:config&gt;
  &lt;/hz:hazelcast&gt;
  </code></pre>
  
  <p>I then made a simple test class having the following method</p>
  
  <pre><code>@Cacheable("somecache")
  public boolean insertDataIntoCache(String data) {
      logger.info("Inserting data = '{}' into cache",data);
      return true;
  }
  </code></pre>
  
  <p>I also made some method to print some information from every map Hazelcast finds and also the entires inside. Inserting the data and caching seems to work fine however the entry never expires even though I set a TTL of 120 seconds.</p>
  
  <p>When I write the data from the cache it shows me that there is one map called "somecache" and that map has a TTL of 120 seconds but when I loop through the entries, it finds all the ones I inserted with a expirationTime of 0. I am not what is supposed to be the behaviour of hazelcast (maybe a map ttl takes precedence over an entry ttl) but in any case it will just not expire.</p>
  
  <p>Is anybody aware of any issues with 3.0.2 and spring cache? I should also mention that I have other applications in the same application server running an older version of Hazelcast however they have their own separate config and my test application seems to be keeping to itself and not conflicting with anything.</p>
  
  <p>Any input is appreciated.</p>
  
  <p>EDIT 1:</p>
  
  <p>It seems to work if I downgrade to using HZ 2.6.3 so it looks like there is a bug somewhere in hazelcast 3 regarding TTL</p>