3
A
回答
2
找到解決方案 - 配置與memcached配置相同。
- 添加以下的的pom.xml
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>spring-cache</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.code.simple-spring-memcached</groupId>
<artifactId>xmemcached-provider</artifactId>
<version>3.3.0</version>
</dependency>
- 添加按照調度-servlet.xml中
<bean name="memcacheManager" class="com.google.code.ssm.spring.SSMCacheManager">
<property name="caches">
<set>
<bean class="com.google.code.ssm.spring.SSMCache">
<constructor-arg name="cache" index="0" ref="defaultCache"/>
<!-- 3 days -->
<constructor-arg name="expiration" index="1" value="259200"/>
<!-- @CacheEvict(..., "allEntries" = true) doesn't work -->
<constructor-arg name="allowClear" index="2" value="true"/>
</bean>
</set>
</property>
</bean>
<bean name="defaultCache" class="com.google.code.ssm.CacheFactory">
<property name="cacheName" value="defaultCache"/>
<property name="cacheClientFactory">
<bean name="cacheClientFactory" class="com.google.code.ssm.providers.xmemcached.MemcacheClientFactoryImpl"/>
</property>
<property name="addressProvider">
<bean class="com.google.code.ssm.config.DefaultAddressProvider">
<property name="address" value="xxx.yyy.cache.amazonaws.com:11211"/>
</bean>
</property>
<property name="configuration">
<bean class="com.google.code.ssm.providers.CacheConfiguration">
<property name="consistentHashing" value="true"/>
</bean>
</property>
</bean>
凡命名空間如下:
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/cache
http://www.springframework.org/schema/cache/spring-cache-3.1.xsd">
相關問題
- 1. AWS ElastiCache c#error
- 2. Redisson w/AWS Elasticache
- 3. Java API來AWS Elasticache
- 4. AWS ElastiCache描述CacheClusters
- 5. AWS Elasticache Redis故障轉移
- 6. aws elasticache redis set並獲得
- 7. 的PHP Zend與AWS ElastiCache
- 8. AWS多區域ElastiCache同步
- 9. 如何在Amazon AWS上配置驅逐(生存時間)Elasticache Redis + Spring數據
- 10. AWS DynamoDB會話與Elasticache PHP會話
- 11. Codeigniter Memcached未連接到AWS Elasticache實例
- 12. Aws elasticache與php的連接問題
- 13. AWS Elasticache PHP會話和冗餘
- 14. 使用java獲取aws elasticache的數據
- 15. AWS Elasticache CPU使用率超過100%
- 16. AWS with Moodle with load Balance
- 17. 爲spring cloud aws配置spring redis緩存?
- 18. OpenCV with AWS Lambda
- 19. AWS iot with esp8266
- 20. AWS CodeDeploy with Symfony1
- 21. Searchkick with aws elasticsearch
- 22. AWS ElastiCache:是否有可能Redis的兼容Elasticache存儲JSON檔案
- 23. Springboot with Spring OAuth2
- 24. Elasticache上的Hangfire
- 25. AWS ItemSearch with Ruby SDK
- 26. AWS with flask(port channel)
- 27. AWS Javascript SDK with Promises
- 28. PHP.INI&session.save_path的&ElastiCache
- 29. AWS Elasticache與週期性任務配合使用
- 30. elasticache -ERR未知命令'PSYNC