alibaba / alibaba/Sentinel

Add global fallback support for AspectJ annotation extension

Open
#3,110 1 comment 0 reactions 0 assignees View on GitHub
area/annotation good first issue kind/feature
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## 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:

```java
public interface SentinelAnnotationGlobalFallback {

Object handle(Method originalMethod, Object[] args, Throwable t) throws Throwable;
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating SentinelResourceAspect, the entry point named in the issue, and review how annotation fallback and defaultFallback are currently handled. Then examine the proposed SentinelAnnotationGlobalFallback interface and define completion around allowing a globally configured fallback to handle exceptions or flow protection when no annotation-level fallback is specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.