Reputation: 1061
i want to substitute memcached for spring-redis.
memcached has function
* @param key key
* @param delta
* increment delta
* @param initValue
* the initial value to be added when value is not found
* @param timeout
* operation timeout
* @param exp
* the initial vlaue expire time, in seconds. Can be up to 30
* days. After 30 days, is treated as a unix timestamp of an
* exact date.
* @return
* @throws TimeoutException
* @throws InterruptedException
* @throws MemcachedException
*/
long incr(String key, long delta, long initValue, long timeout, int exp)
throws TimeoutException, InterruptedException, MemcachedException;
spring-redis has function
Long increment(K key, long delta);
how can i set operation timeout(not expire) in spring-redis?
Upvotes: 2
Views: 852
Reputation: 6351
spring-redis doesnt allow you to configure timeout per individual request (as in memcached realization). You can configure timeout per connection with a configuration setting in application.properties:
spring.redis.timeout=5000
Upvotes: 1