alibaba / alibaba/jetcache

@CreateCache和@Cached的area问题

Open
#602 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
5.6k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

我是用@Cached创建缓存,此时能看到创建成功,且key为process_Message:123456
@Cached(area = "process", name = "Message:", key = "#messageId", expire = 7, timeUnit = TimeUnit.DAYS, cacheType = CacheType.REMOTE)
public Message getMessage(String messageId) {
xxxx;
}

当我利用@CreateCache删除缓存时(cache.REMOVE()),回调结果返回NOT_EXISTS
@CreateCache(area = "process", name = "Message:", expire = 7, cacheType = CacheType.REMOTE, timeUnit = TimeUnit.DAYS)
private Cache cache;

当我修改name为process_Message:时,再次进行cache.REMOVE(),回调结果返回SUCCESS
@CreateCache(area = "process", name = "process_Message:", expire = 7, cacheType = CacheType.REMOTE, timeUnit = TimeUnit.DAYS)
private Cache cache;


删除时是不是未考虑到area?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the mismatch using the shown @Cached and @CreateCache examples, comparing the generated key with the key used by cache.REMOVE(). Trace how area and name are combined for each annotation. Done means removing the cache created by @Cached returns SUCCESS without manually adding the area prefix to name.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.