alibaba / alibaba/Sentinel

SentinelResourceAspect为什么不提供parseOrigin的扩展

Open
#2,304 0 comments 0 reactions 0 assignees View on GitHub
area/annotation
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

![image](https://user-images.githubusercontent.com/12644274/126951308-6c72b456-92fc-4f4e-b02b-fc2ea157d6b7.png)
![image](https://user-images.githubusercontent.com/12644274/126951463-be11aa27-b6ec-40ff-9e6c-6b222a3dab4a.png)
SentinelWebInterceptor(AbstractSentinelInterceptor)有提供parseOrigin扩展【protected com.alibaba.csp.sentinel.adapter.spring.webmvc.AbstractSentinelInterceptor#parseOrigin】
SentinelResourceAspect为什么没有parseOrigin的扩展,当不使用http请求时(没有HttpServletRequest),可以从org.aspectj.lang.JoinPoint#getArgs方法中获取指定参数,并从中取到一些有用的信息(意义等同于origin),我的解决办法是重写SentinelResourceAspect,这可能是个比较常用的场景,暂时不支持,至少开放一下接口嘛

Contributor guide

Open the contributing guide

Research direction

Start by reading SentinelResourceAspect and compare its origin handling with AbstractSentinelInterceptor#parseOrigin. Inspect how JoinPoint#getArgs could provide origin data when no HttpServletRequest is available. Done means defining and exposing a supported parseOrigin extension for SentinelResourceAspect without changing existing HTTP behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.