1234567891011121314151617181920212223242526272829303132333435 |
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:c="http://www.springframework.org/schema/c"
- xmlns:p="http://www.springframework.org/schema/p" 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-4.0.xsd
- http://www.springframework.org/schema/context
- http://www.springframework.org/schema/context/spring-context-4.0.xsd
- http://www.springframework.org/schema/cache
- http://www.springframework.org/schema/cache/spring-cache-4.0.xsd"
- default-autowire="byName">
- <cache:annotation-driven cache-manager="cacheManager" />
- <context:component-scan base-package="com.uas" />
- <!-- redis 相关配置 -->
- <bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
- <property name="maxIdle" value="300" />
- <property name="maxWaitMillis" value="3000" />
- <property name="testOnBorrow" value="true" />
- </bean>
- <bean id="connectionFactory"
- class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
- p:host-name="192.168.253.111" p:port="6379" p:pool-config-ref="poolConfig"
- p:database="0" />
- <bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
- <property name="connectionFactory" ref="connectionFactory" />
- </bean>
- <bean id="cacheManager" class="org.springframework.data.redis.cache.RedisCacheManager"
- c:redis-operations-ref="redisTemplate" />
- </beans>
|