question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we share sharing the same Redisson client for both Hibernate L2 cache and Spring Cache Abstraction

See original GitHub issue

Can 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
jacob-swansoncommented, Dec 14, 2020

@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 custom RedissonRegionFactory.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found