发表于: 2020-01-04 22:58:50
1 1218
今天做了什么
整合memCached
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:memcached.properties</value>
</list>
</property>
</bean>
<bean id="memcachedPool" class="com.whalin.MemCached.SockIOPool" factory-method="getInstance"
init-method="initialize" lazy-init="false" destroy-method="shutDown">
<constructor-arg>
<value>memcachedPool</value>
</constructor-arg>
<property name="servers">
<list>
<value>${memcache.server}:${memcached.port}</value>
</list>
</property>
<property name="initConn" value="${memcache.initConn}"/>
<property name="minConn" value="${memcache.minConn}"/>
<property name="maxConn" value="${memcache.maxConn}"/>
<property name="maintSleep" value="${memcache.maintSleep}"/>
<property name="nagle" value="${memcache.nagle}"/>
<property name="socketTO" value="${memcache.socketTO}"/>
</bean>
<bean id="memcachedClient" class="com.whalin.MemCached.MemCachedClient" >
<constructor-arg>
<value>memcachedPool</value>
</constructor-arg>
</bean>
</beans>
在spring中导入
进行简单测试
结果:
明天要做什么
在service里整合使用缓存
在服务器进行测试
评论