Andrew Tomlinson
Andrew Tomlinson

Reputation: 1

Get region_prefix to work with redisson-hibernate-53 L2 cache

I am trying to configure Redis as Hibernate's L2 cache for Spring boot app using Redisson (Spring 2.3.0, Hibernate 5.4.15, redisson-hibernate-53).

The application YAML has this section under spring.jpa.properties.hibernate

        cache:
          use_second_level_cache: true
          region.factory_class: org.redisson.hibernate.RedissonRegionFactory
          region_prefix: app1
          redisson:
            config: redisson.yaml
            fallback: true

Everything works except the region_prefix. The response from running KEYS * in redis-cli shows that the main key is the fully qualified class name of my Cacheable entity but it does not have the region prefix. I cannot see any reference in the RedissonRegionFactory and related code to Hibernate's RegionNameQualifier.

Has anyone got this working or is it a bug?

Upvotes: 0

Views: 1020

Answers (1)

rkd
rkd

Reputation: 27

You cannot get it to work. I opened an issue and they fixed it immediately. It will be released with Redisson 3.13.7. Redission ignored the cache region prefix.

see issue

Upvotes: 1

Related Questions