I have a requirement of connecting to tow Redis hosts from same application. Host to be connected to is based a runtime condition for failover. I have created 2 RedisTemplate instances with separate LettuceConnectionFactory objects, both with sharedNativeConnection flag as true. I want to use one connection per each redisTemplate. But I have observed that connection is being shared across redisTemplate instances. I have checked in debug mode that when invoking get operation using redisTemplate2, the connection fails with exception(due to an issue with host1) and stacktrace contains host1 socketaddress, whereas host field in standardConfiguration object is host2. What is the way of using shared connection per redisTemplate and not across multiple redisTemplate instances.
0
There are 0 best solutions below
Related Questions in SPRING-DATA-REDIS
- Service in Docker Compose not connecting to Redis container in docker, Failed to connect to any host resolved for DNS name
- Query regarding @Cacheable in Spring Boot
- How to subscribe redis key space event with spring
- What is the difference between putting @Cache in Entities and @QueryHints in Queries?
- class file for redis.clients.jedis.JedisPoolConfig not found
- NullPointerException when using @Transactional with Spring Data Redis
- The RedisCommandExecutionException, ERR unknown command `CONFIG`, with args beginning with: `GET`, `notify-keyspace-events`
- getClusterConnection.clusterGetNodes always return 1 node
- Getting RedisConnectionFailureException intermittently
- Multiple connections are used even when shareNativeConnection is enabled in spring-data-redis LettuceConnectionFactory
- I cannot change spring session ttl data in redis
- WRONGTYPE Operation against a key holding the wrong kind of value when use GeoOperations class in spring data redis
- What to do when the storage service is down while using Spring Session?
- Redis Query-by-Example does not support string matcher STARTING, ENDING using Spring data redis
- How to use RedisTimeSeriesCommands with jedis in Java Spring Boot
Related Questions in LETTUCE
- Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version
- lua script from java (io-lettuce-core)
- Redis Cluster performance not increasing linearly with Lettuce
- Multiple connections are used even when shareNativeConnection is enabled in spring-data-redis LettuceConnectionFactory
- Redis two operations performing in single command like String command and Hash command at a time for fetching their values from Redis Server
- Spring data redis LettuceConnectionFactory : sharedConnection is shared across multiple RedisTemplate instances resulting in unexpected behavior
- Redis client Lettuce can't connect to embedded RedisServer but Jedis can connect
- Connecting to Cloud Redis Instance using Lettuce
- Redis Lettuce not distributing requests to all slave instances in v5.1
- Lettuce client not able to detect Redis failure immediately
- Redis Lettuce: Transaction with different codecs
- Lettuce.io - How to prevent a Redis channel becoming inactive?
- How to test interactions inside of a Futures `whenComplete` method
- Using static redis connections in multithreaded env in Java
- What does it mean when Lettuce Core logs indicate missing epoll and kqueue libraries during initialization?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?