alibaba / alibaba/jetcache

多个EnableMethodCache 只生效一个?

Open
#249 7 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

在 CreateCacheTest 中
@Configuration
@ComponentScan(basePackages = "com.alicp.jetcache.test.beans")
@EnableMethodCache(basePackages = "com.alicp.jetcache.support")
@EnableCreateCacheAnnotation
public static class B {

}

@Configuration
@ComponentScan(basePackages = "com.alicp.jetcache.test.beans")
@EnableMethodCache(basePackages = "com.alicp.jetcache.test.beans")
@EnableCreateCacheAnnotation
@Import(B.class)
public static class A {

最后JetCacheProxyConfiguration的CacheAdvisor 的字段BasePackages只生效了 com.alicp.jetcache.support这一个包名

有没有支持两个包名同时生效的方法?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with CreateCacheTest and the JetCacheProxyConfiguration.CacheAdvisor field BasePackages, then trace how the two @EnableMethodCache declarations in configurations A and B are processed. Confirm whether both com.alicp.jetcache.support and com.alicp.jetcache.test.beans are retained, and verify that method caching applies to components in both packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
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.