Can we share sharing the same Redisson client for both Hibernate L2 cache and Spring Cache Abstraction
See original GitHub issueCan we share sharing the same Redisson client for both Hibernate L2 cache and Spring Cache Abstraction? I am configuring redisson as my l2 cache in application.propeties
region:
factory_class: org.redisson.hibernate.RedissonRegionFactory
redisson:
config: redisson.json
Currently, I am creating a Cache manager bean using the below code, which creates a new connection to redis.
@Bean
public RedissonClient redissonClient() throws IOException {
Resource resource = resourceLoader.getResource("classpath:/" + redissonConfigFile);
Config config = Config.fromYAML(resource.getInputStream());
return Redisson.create(config);
}
@Bean
public CacheManager cacheManager(RedissonClient redissonClient) {
return new RedissonSpringCacheManager(redissonClient);
}
I want to create a Cache Manager bean use the same connection configured in application properties. Is it possible to do that?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
sharing same hazelcast client instance for both Hibernate L2 ...
My app is using both hibernate 2nd level cache and Spring cache abstraction. Is there a way to configure them to share the...
Read more >Hibernate, Redis, and L2 Cache Performance - DZone Java
It's true that Redisson provides the only known integration for Redis as Hibernate L2 cache. But there's nothing preventing us from writing our ......
Read more >Does Redisson Hibernate Cache Module share same data in ...
Yes, it does. It's the purpose of the module. Java application in the first container doesn't see updates of the records. You might ......
Read more >Configuring Azure Redis Cache to boost Spring Boot ...
Redisson supports both Hibernate 2nd level cache and the Spring Cache abstraction. If you want to unlock its best features, you will need...
Read more >Redis L2 Cache Integration Using Jedis
Redisson has different codecs and it can also be augmented with local caching to boost performance. However, Redisson's local caching options ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Its working by https://github.com/redisson/redisson/issues/3212#issuecomment-727776569
@ManeeshSharma17 would you mind sharing your solution? I’ve tried a couple things, but I’m not able to get the
RedissonClient
from inside my customRedissonRegionFactory
.