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

Add global fallback support for AspectJ annotation extension #3110

Open
sczyh30 opened this issue Apr 27, 2023 · 1 comment · May be fixed by #3116 or #3383
Open

Add global fallback support for AspectJ annotation extension #3110

sczyh30 opened this issue Apr 27, 2023 · 1 comment · May be fixed by #3116 or #3383
Labels
area/annotation Issues or PRs related to annotation support good first issue Good for newcomers kind/feature Category issues or prs related to feature request.

Comments

@sczyh30
Copy link
Member

sczyh30 commented Apr 27, 2023

Issue Description

Type: feature request

Describe what feature you want

Add global fallback support for AspectJ annotation extension.

@SentinelResource 注解方式埋点支持全局自定义 fallback,作为通用的兜底 fallback。在这个场景下,即使没有在 @SentinelResource 中指定 fallback 和 defaultFallback,只要在创建 SentinelResourceAspect 时指定了全局自定义 fallback,在出现异常或流量防护触发时 也会走到全局自定义 fallback 中。

Describe your initial design (if present)

Add an interface like this, and support creating SentinelResourceAspect with it:

public interface SentinelAnnotationGlobalFallback {

    Object handle(Method originalMethod, Object[] args, Throwable t) throws Throwable;
}
@sczyh30 sczyh30 added good first issue Good for newcomers kind/feature Category issues or prs related to feature request. area/annotation Issues or PRs related to annotation support labels Apr 27, 2023
@luffy0223
Copy link

Referring to the revised issue description, I have redesigned the SentinelResourceAspect and its usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/annotation Issues or PRs related to annotation support good first issue Good for newcomers kind/feature Category issues or prs related to feature request.
Projects
None yet
2 participants