Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用api创建redis redis.springdata缓存不起作用 #828

Open
EvianTian opened this issue Oct 13, 2023 · 0 comments
Open

使用api创建redis redis.springdata缓存不起作用 #828

EvianTian opened this issue Oct 13, 2023 · 0 comments

Comments

@EvianTian
Copy link

如题,使用@cached注解创建redis redis.springdata缓存正常,使用api创建的不起作用,掉put存入缓存后,实际redis中无数据,无任何报错信息。

springboot 版本2.4.3
redsi版本 3.2.1
jetcache版本 2.6.7 2.7.4都试过还是不行

jetcache 2.6.7
redis缓存
GenericObjectPoolConfig pc = new GenericObjectPoolConfig();
pc.setMinIdle(2);
pc.setMaxIdle(10);
pc.setMaxTotal(10);
JedisPool jedisPool = new JedisPool(pc, "localhost", 6379,15,"123456",15);

    String keyPrefix = "projectA:default_" + "demo:";
    this.cache = RedisCacheBuilder.createRedisCacheBuilder()
           .jedisPool(jedisPool)
           .keyPrefix(keyPrefix)
           .expireAfterWrite(60, TimeUnit.SECONDS)
           .buildCache();

redis.springdata缓存

this.cache = RedisSpringDataCacheBuilder.createBuilder()
.keyPrefix(keyPrefix)
.connectionFactory(redisConnectionFactory)
.buildCache();

jetcache 2.7.4
redis缓存 和 redis.springdata缓存
QuickConfig qc = QuickConfig.newBuilder(CACHE_NAME)
.expire(Duration.ofSeconds(100000))
.cacheType(CacheType.REMOTE)
.penetrationProtect(true)
.useAreaInPrefix(true)
.syncLocal(true)
.build();
this.cache = cacheManager.getOrCreateCache(qc);

使用RedisSpringDataCacheBuilder RedisCacheBuilder 都不行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant