Support adding prefix to Dubbo service resource name in Sentinel Dubbo Adapter - #859
Conversation
using the LongAdder rather than AtomicInteger to Provides better performance
merge master
merge online
merge onlie
Codecov Report
@@ Coverage Diff @@
## master #859 +/- ##
============================================
+ Coverage 42.06% 42.81% +0.75%
- Complexity 1410 1461 +51
============================================
Files 307 312 +5
Lines 8868 9017 +149
Branches 1200 1226 +26
============================================
+ Hits 3730 3861 +131
- Misses 4681 4691 +10
- Partials 457 465 +8
Continue to review full report at Codecov.
|
sczyh30
left a comment
There was a problem hiding this comment.
We need to add the feature in both sentinel-dubbo-adapter (for 2.5.x-2.6.x) and sentinel-apache-dubbo-adapter (for 2.7.x+).
| */ | ||
| public final class DubboConfig { | ||
|
|
||
| public static final String DUBBO_USE_PREFIX = "csp.sentinel.dubbo.use.prefix"; |
There was a problem hiding this comment.
Maybe csp.sentinel.dubbo.use.prefix -> csp.sentinel.dubbo.resource.use.prefix is clearer? (though too long...)
So as the following two keys.
There was a problem hiding this comment.
config keys had modified
|
|
||
| public static String getDubboProviderPrefix() { | ||
| if (usePrefix) { | ||
| return SentinelConfig.getConfig(DUBBO_PROVIDER_PREFIX); |
There was a problem hiding this comment.
Can we provide a default pattern (e.g. dubbo:provider/consumer: + the origin name) if the usePrefix is enabled but no prefix is provided?
There was a problem hiding this comment.
Can we provide a default pattern (e.g.
dubbo:provider/consumer:+ the origin name) if theusePrefixis enabled but no prefix is provided?
default prefix had provided
|
Could you please also add these implementations in |
implementations had supplied |
|
Thanks for contributing! |
* [RIP-9] Add Operations_Trace.md in recketmq
Does this pull request fix one issue?
Fix #427
Describe how you did it
add three configs:
csp.sentinel.dubbo.use.prefixuse to control the prefix if take effect or notcsp.sentinel.dubbo.provider.prefixconfig the dubbo provider service resource prefixcsp.sentinel.dubbo.consumer.prefixconfig the dubbo consumer service resource prefixDescribe how to verify it
i offer a test :
com.alibaba.csp.sentinel.adapter.dubbo.DubboUtilsTest#testGetResourceNameWithPrefixSpecial notes for reviews
none