title: Cache manager with Spring Data Redis 2.0.3
body: <p>Currently, I'm using spring cache by using @Cachable with Ehcache. I'm about to replace Ehcache with Redis by using Spring Data Redis 2.0.3. All examples I see on the web are based on the old versions of it but the new version has the different format of constructors.</p>
  
  <p>This is my current cacheManager conf:</p>
  
  <pre><code>&lt;bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"&gt;
      &lt;property name="configLocation" value="classpath:ehcache.xml"/&gt;
      &lt;property name="shared" value="true"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The example of using Redis based on the older version is:</p>
  
  <pre><code>&lt;bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager"
          c:template-ref="redisTemplate" /&gt;
  </code></pre>
  
  <p>The constructor in the new version is totally different from the older versions and all examples of the new version put everything into cache manually like this:</p>
  
  <pre><code>redisTemplate.opsForHash().put(user.getObjectKey(), user.getKey(), user);
  </code></pre>
  
  <p>I still want to use cacheManager and <code>@cachable</code> but have no idea how to configure the <code>cacheManager</code> bean with the new version of Spring Data Redis. The constructor of the new versions needs RedisCacheWriter:</p>
  
  <pre><code> public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration) 
  </code></pre>
  
  <p>I appreciate if you can share your idea about how to set up <code>cacheManager</code> to use <code>@Cachable</code> with the new version of Spring Data Redis(min 2.0.3).</p>