配置文件
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxIdle" value="300" />
<property name="maxTotal" value="60000" />
<property name="testOnBorrow" value="true" />
</bean>
<bean id="jedisPool" class="redis.clients.jedis.JedisPool">
<constructor-arg index="0" ref="jedisPoolConfig" />
<constructor-arg index="1" value="${redis.host}" />
<constructor-arg index="2" value="${redis.port}" type="int" />
</bean>
<bean id="redisConnectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<property name="poolConfig" ref="jedisPoolConfig"></property>
<property name="hostName" value="${redis.host}"></property>
<property name="port" value="${redis.port}"></property>
<property name="password" value="${redis.keyPrefix}"></property>
<property name="usePool" value="true"></property>
</bean>
<bean id="jedisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="redisConnectionFactory"></property>
<property name="defaultSerializer">
<bean class="org.springframework.data.redis.serializer.StringRedisSerializer"/>
</property>
</bean>
<bean id="jedisQueueListener" class="com.jeeplus.common.redis.queue.QueueListener"/>
<bean id="jedisQueue" name="jedisQueue" class="com.jeeplus.common.redis.queue.RedisQueue" destroy-method="destroy">
<property name="redisTemplate" ref="jedisTemplate"></property>
<property name="key" value="user:queue"></property>
<property name="maxLimit" value="50"></property>
<property name="listener" ref="jedisQueueListener"></property>
</bean>
在linux的redis-cli lpush队列没被监听
链接异常。