RpcContext新增remoteApplicationName字段 #3816
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
In the process of using Dubbo, there are many scenarios where the Provider needs to know the applicationName of the Consumer (not just the Consumer IP). For example, I want to output the upstream caller to the log file and want to limit the flow according to the upstream application. Or downgrade, want to use the upstream application for arson drills, etc., so we usually add Filter to achieve (for example, DubboAppContextFilter in Sentinel, which is specifically done on the Consumer side: https://github.com/alibaba/Sentinel/ Blob/6bb4ff21dadde00c9453a5f57d030d55f87b71a8/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java), so I also hope that Dubbo can put this inside Simple things have been done
在我们使用Dubbo的过程中,有很多场景Provider端需要知道Consumer端的applicationName(而不仅仅只需要知道Consumer的IP),比如我想将上游调用方输出到出入口日志中、想根据上游应用来限流或降级、想根据上游应用来进行放火演练等,所以我们通常会自己加Filter来实现(例如Sentinel中的DubboAppContextFilter,就是专门在Consumer端做这个事情:https://github.com/alibaba/Sentinel/blob/6bb4ff21dadde00c9453a5f57d030d55f87b71a8/sentinel-adapter/sentinel-dubbo-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java),
所以,我也特别希望Dubbo内部能把这块简单的事情给做了