alibaba/Sentinel

Add global fallback support for AspectJ annotation extension

オープン

#3,110 opened on 2023/04/27

 (1 件のコメント) (0 件のリアクション) (0 人の担当者)Java (8,150 件のフォーク)batch import
area/annotationgood first issuekind/feature

Repository metrics

Stars
 (23,109 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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;
}

コントリビューターガイド