首页 > 解决方案 > 获取 region_prefix 以使用 redisson-hibernate-53 L2 缓存

问题描述

我正在尝试使用 Redisson(Spring 2.3.0、Hibernate 5.4.15、redisson-hibernate-53)将 Redis 配置为 Spring Boot 应用程序的 Hibernate 的 L2 缓存。

应用程序 YAML 在 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

除 region_prefix 外,一切正常。在 redis-cli 中运行的响应KEYS * 显示主键是我的 Cacheable 实体的完全限定类名,但它没有区域前缀。RedissonRegionFactory我在Hibernate 的相关代码和相关代码中看不到任何引用RegionNameQualifier

有没有人有这个工作或者它是一个错误?

标签: hibernatecachingredisredisson

解决方案


你不能让它工作。我打开了一个问题,他们立即修复了它。它将与Redisson 3.13.7. Redission 忽略了缓存区域前缀。

问题


推荐阅读