Jetcache如何动态设置全局缓存启用禁用
- Dominant language
- Java
- Stars
- 5.6k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
项目使用了jetcache,想要做一个统一缓存开启关闭开关(通过Apollo配置定义enabledCache,来控制缓存启用禁用)。但是试了@Cached注解的condition属性,使用spel表达式不能调用bean的方法,下面三种写法都报错:
1) condition =“#{employeeConfig.getEnabledCache()}” ;不认识表达式“”{}“”
2) condition =“#employeeConfig.getEnabledCache()” ;employeeConfigFactory 为null
3) condition =“employeeConfig.getEnabledCache()” ;不认识表达式
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how @Cached evaluates its condition attribute and how SpEL resolves employeeConfig or other beans. Check the Apollo-backed enabledCache requirement and the three reported expression failures; done means one consistent global switch can enable or disable caching without those evaluation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100