RpcContext新增remoteApplicationName字段#3816
Merged
htynkn merged 1 commit intoapache:masterfrom Apr 10, 2019
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3816 +/- ##
============================================
- Coverage 63.64% 63.62% -0.02%
Complexity 71 71
============================================
Files 704 704
Lines 31065 31069 +4
Branches 5037 5037
============================================
- Hits 19772 19769 -3
- Misses 9024 9028 +4
- Partials 2269 2272 +3
Continue to review full report at Codecov.
|
htynkn
approved these changes
Apr 10, 2019
Member
htynkn
left a comment
There was a problem hiding this comment.
Looks good to me.
Remote application name only used in tag router now(https://github.com/apache/incubator-dubbo/blob/master/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java#L237) and I think it make sense to include in context
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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内部能把这块简单的事情给做了