cache switch

 

Cache switching:

To switch the cache, just change the id to the class corresponding to the cacheManager (cache manager)

<cache:annotation-driven />

 

<!-- 

Set cache timeout

<property name="expires">

<map>

                <entry key="findByAreaLevel" value="100" />

                <entry key="BasLkpDao_findByBusinessType" value="10" />

            </map>

</property>

-->

 

<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:use-pool="true" p:hostName="10.0.1.224" p:port="6379" />

 

 

<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate" p:connection-factory-ref="jedisConnectionFactory" />

 

 

<bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager" c:redisOperations-ref="redisTemplate"  />

<!--

<bean id="cacheManager" class="org.springframework.cache.concurrent.ConcurrentMapCacheManager" /> 

-->

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326504568&siteId=291194637