My application consists of a Spring wait controller that calls a service using redis. I am using Spring boot startter redis 1.2.5 and I defined the template in the beans.xml file:
<bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name="${spring.redis.host}"
p:use-pool="true"
p:port="${spring.redis.port}"
/>
<bean id="redisTemplateForTransaction" class="org.springframework.data.redis.core.RedisTemplate"
p:connection-factory-ref="jedisConnectionFactory"
p:keySerializer-ref="stringRedisSerializer"
p:valueSerializer-ref="jsonRedisSerializerForTransaction"
p:enableTransactionSupport="true">
<qualifier value="redisTemplateForTransaction" />
</bean>
When I run more than 8 requests, my application blocks. As far as I understand, I reached the default number in the default pool.
Why are connections not automatically returned at the end of request processing?
How to work in transactional mode so that any incoming request receives its redis connection and returns it at the end of processing?
source
share