Hello
How to use pipelining in Spring Data Key Value 1.0.0.M2? For example how to get someting like this in pipeline:
RedisTemplate<String, Long> rt = new RedisTemplate<String, Long>(jedisConnection);
rt.boundZSetOps("ordset1").rangeByScore(1, 5);
rt.boundZSetOps("ordset2").rangeByScore(1, 5);
rt.boundZSetOps("ordset3").rangeByScore(1, 5);
I try many simple variants of code but allways after 4-8 request my page stop responding.
This code return 0 result, after 4-8 gets app not responding:
stringRedisTemplate.getConnectionFactory().getConn ection().openPipeline();
stringRedisTemplate.boundValueOps("k1").get();
stringRedisTemplate.boundValueOps("k2").get();
stringRedisTemplate.boundValueOps("k3").get();
stringRedisTemplate.boundValueOps("k4").get();
List<Object> result = stringRedisTemplate.getConnectionFactory().getConn ection().closePipeline();
logger.info(result.size());
This code return 3 result, after 4-8 gets app not responding:
JedisConnection jc = jedisConnection.getConnection();
Pipeline p = jc.getNativeConnection().pipelined();
p.get("k1");
p.get("k2");
p.get("k3");
List<Object> results = p.execute();
logger.info(results.size());
Mayby close/execute pipeline remove connection from pool?
This is my bean:
<bean id="jedisConnection" class="org.springframework.data.keyvalue.redis.con nection.jedis.JedisConnectionFactory">
<property name="hostName" value="192.168.10.124"/>
<property name="port" value="6379"/>
<property name="timeout" value="2000"/>
<property name="usePool" value="true"></property> //disable this dont change anything
</bean>


Reply With Quote