alibaba / alibaba/jetcache

@Cached 能否自定义Key,不使用Spel表达式

Open
#751 2 comments 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

现在我想要使用一个固定的字符串作为Key,类似于下面的例子,但是会报SpEL解析错误
```
@Cached(area = "test", name = "name", key = "key1")
public Response getResponse(){

}
```

`org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'key1' cannot be found on object of type 'com.alicp.jetcache.anno.method.SpringCacheInvokeContext' - maybe not public or not valid`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the @Cached annotation's key handling and SpringCacheInvokeContext, then trace how the key is evaluated by Spring SpEL. Done means a fixed string such as "key1" is accepted as the cache key without a SpEL property-resolution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
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.