-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fluent -style builder API support. #3431
Comments
ConfigManager can work as the basis for the Builder: https://github.com/apache/incubator-dubbo/blob/master/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/context/ConfigManager.java |
Good idea! |
Cool,I love it |
nice |
I think the export and refer method of DubboBuilder can provider overload methods such as DubboBuilder.export(ServiceConfig service, ProviderConfig provider, RegistryConfig registry)
java
if users would like to refer specific config to a service or a reference. They can config by themselves. |
I would suggest providing the service-restricted configs using ServiceConfigBuilder: What do you think? @tswstarplanet |
Is there anyone who's interested and want to give it a try? |
Yes, it looks good. We should also limit reproduction of global configs, such as application. |
I want to try this issue.And I will commit a pr after serveral days |
Yes, the |
@Bricks-Man Awesome, please let me know if you have any problem. |
Further thought on this topic. A unified entry like
|
@chickenlj I have finished this issue.Could you have time to do a review for it?Please tell me if you have any question. |
* Release resource after use in ConfigParserTest (#3127) Release resource after use in ConfigParserTest * add javadoc for registry and some code (#3140) add javadoc for registry and optimize code * Correct spelling error (#3146) * Code optimization (#3118) * code optimization * useless import * optimization * Code rule (#3016) * code optimization (#3167) code optimization * Add javadoc for dubbo-serialization module(#3002). (#3004) Add javadoc for dubbo-serialization module(#3002). * optimize ReconnectTimerTask's log output (#3162) * optimize log output * Separate logs for reconnect and close * remove reconnect exception log * add some small optimize (#3171) * modify some log describe * use java8 lambda expression * fix telnet trace times is always 1 (#3038) * fix telnet trace times is always 1 * use StringUtils determine if the string is empty * Fix 3105 , make invoke command with Json string parameter without "class" key * Fix 3105 ,Keep the class key to support overloaded methods * optimize InvokerTelnetHandlerTest * Upgrade junt to junit5 (#3149) * upgrade junit to junit5 * modify test * 批量修改upgrade_junt_to_junit5 * 删除多余的文件 * fi test case * Disabled soem test case temporarily * upgrade junit to junit5 and batch modify test case * copy some code from jupiter5.4.0.M1 for some issues * 修改rat福泽 * update rat path * revert case * add junit-platform-surefire-provider to maven-surefire-plugin * update dependency * fix coverage issue (#1) * use jupiter 5.4.0-M1 and remove junit5 source code * Format change. * fix wrong word spelling (#3217) * Fix provicer --> provider (#3222) * Optimize the code: use logger instead of printStackTrace(). (#3202) * Optimize code: remove unnecessary judgment code. (#3196) * Optimize the code: fix CallbackServiceCodec.java exportOrunexportCallbackService method issue. (#3199) * Optimize the code: fix url to null, NullPointerException, change private variable to camel mode. * Optimize the code: exportOrUnexportCallbackService method camel mode. * Optimize the code: fix method:encodeInvocationArgument private callbackStatus is camel writing. * Optimize the code: fix name issue * Exporter is a noun, we should use a verb here, like Export. * The generics that can be inferred automatically are also deleted. * Refactor telnet invoke command (#3210) * refactor telnet invoke command * add select command for telnet * fix test case * Remove deprecated AnnotationBean, please refer #1485 for the new method to replace. (#3232) * [Dubbo-3231]keep TagRouter consistent with 2.6.x (#3233) * keep TagRouter consistent with 2.6.x * refactor filterUsingStaticTag using lambda in tagRouter * Modified to lower camel case (#3003) * wrong event setting (#3043) * wrong event setting * modify event seeting * modify * call the util method (#3230) * Code optimization, call the util method * mofidy * modify * * import package * Qos heart (#3170) * qos heart question fix #3165 * modify * judge if it's a IdleStateEvent * add UT * modify * Merge pull request #3246 from cvictory:2.7.0-release remove gson from dubbo.jar in shading mode , and change to dependency way. * just for modify comments and imports * remove gson from dubbo.jar in shading mode, add dependency * Extract compareTo impl to Router interface and concrete Router only responsible for provide priority. (#3240) something is waiting for us to disscuss: 1. Every Route implement should set a priority? 2.#3249 * Protocol compatibility (#3254) add default method into Protocol . * remove getContext() (#3235) * modify some typos (#3257) * modify some typos * fix some other addionalParameterKeys and paramter typos * Merge 2.6.6 source code into 2.7 (#3241) * Merge 2.6.6 source code into 2.7 * Fixed logging level for #3241 (comment) * Change the implementation for #3241 * Remove the implementation Ordered, because it does not work in Spring Framework : #3241 * Remove the implementation Ordered, because it does not work in Spring Framework : #3241 * Only Optimize Imports * Add activation for the release profile * Update the Java SE link to Java 8. * Move the doclint configuration to correct position. * Deactivate maven release profile. * Fix final name. * Optimize the Apollo extension of Config-Center SPI * must shutdown thread pool when no in use (#3255) * must shutdown thread pool when no in use * Update 2.7.0 release notes * Igonre .patch file. * [maven-release-plugin] prepare release dubbo-2.7.0 * [maven-release-plugin] prepare for next development iteration * [maven-release-plugin] prepare release dubbo-2.7.0 * [maven-release-plugin] prepare for next development iteration * Bring back redis auth UT (#3278) * Optimize code: Fix Constructor to determine illegal logic problems (#3197) * fix return type (#3284) * use standardcharset.utf-8 instead of literal (#3285) * use standardcharset.utf-8 instead of literal * remove unused import * Move the iteration of methods of a service config to the if block of the class have method declared not by Object; remove some useless parameter type (#3282) * Add shutdown command for telnet (#3280) * telnet add shutdown command * refactor rename shutDown to shutdown * remove unregister in doDestroy * unregister the ShutdownHook when the shutdown command invoked * Ignore mvn wrapper binary files. * [maven-release-plugin] prepare release dubbo-2.7.0 * [maven-release-plugin] prepare for next development iteration * Fix typo (#3293) * Improve/heartbeat (#3276) * add the notice of code style * modify the pic * del teh faq.md, move to dubbo admin * improve:remove the heartbeat on server side * improve:change the scope of timer to static * code optimization (#3297) * further enhancement for pull request #3297, also fix an issue introduced in this pull request (#3303) * further enhancement for pull request #3297, also fix an issue introduced in this pull request * rename the variable * enhance the readability * Fix UT conflicts of merging 2.7.0-release * Remove usage of classes in Junit 4 * Remove usage of classes in Junit 4 * Remove usage of classes in Junit 4 * Remove usage of classes in Junit 4 * Remove usage of classes in Junit 4 * remove not used import (#3309) * remove unused import (#3311) * remove not used import * remove unused import * Degrade some UTs in dubbo-config-spring to use junit 4. * use beforeEach and afterEach * Merge pull request #3295, unregister consumer url when client destroyed (referenceconfig#destroy). * fix client reconnect offline provider. * refactor cancel future. * fix client reconnect offline provider. * refactor cancel future. * fix client reconnect offline provider. * refactor cancel future. * fix unregister when client destroyed * Optimize heartbeat (#3299) * Optimize heartbeat. We should cancel the timeout when the client or server is close. * change the hashedWheelTimer's ticks * Optimize tasks keeper. * fix timeout cancel to task cancel. keep task directly. * simply telnet command enabled check logic (#3316) * simply telnet command enabled check * Add comments, manually merge #3181. * Fix for loop reference test pass on protostuff (#3252) * Fix maven compile warning (#3322) * Merge pull request #3174, make timeout filter not work in async way. * Merge pull request #3323, fix double-checked locking. * Merge pull request #2959, fix a bug of service config. * Fix random ut falling in DubboMonitorTest (#3327) * Merge pull request #3017, fixes #2981, refresh invocation's attachments in each invoke. Fixes #2981. * Merge pull request #3141, optimize outbound event and some code formatting. * Merge pull request #3333, add @OverRide for sub-class method. * Fix thrift protocol, use path to locate exporter. (#3331) * Fix thrift protocol, use path to locate exporter. * Fix UT * fix #2842. remove duplicate SPI definitions for 2.7.x (#3340) remove duplicate SPI definitions for 2.7.x * fix org.apache.dubbo replace com.alibaba.dubbo (#3338) org.apache.dubbo replace com.alibaba.dubbo * fix the typo of notification mail list address (#3335) fix the typo of notification mail list address * Review code of TypeDefinitionBuilder (#3064) * Review code of TypeDefinitionBuilder 1. use init method to init builds' list * use single list for all builders. Seems like the builder is thread-safe, we can keep them static and final. * clean code. * [Dubbo-3339] Remove futility check code (#3346) * Remove futility check code * add no-argument constructor method to URL.java fix #3342 (#3350) * Fix NullPointerException when Hessian instantiate URL with JavaDeserializer * Enable ZookeeperMetadataReportTest (#3360) * Package name error (#3354) * some optimize on ExtensionLoader (#3307) * some optimize on ExtensionLoader * make ci rerun * fix compile error * fix ci failure * Fix some unit test failure (#3337) * Fix compilation error fix #3365 (#3366) * [Dubbo-900] Fix 通过 override 修改 hessian协议的提供者的配置 不生效 #900 (#3363) * reExport fail fix#900 * modify * use Objects.equals * compare URL for all proxy protocol * delete useless judgment (#3326) * Fix self assignment (#3301) * Fix self assignment * Replace set with list to insure item order * Minor tweak of codestyle * [Dubbo-2423] Multicast demo fails with message "Can't assign requested address". (#3317) * Fix #2423, Multicast demo fails with message "Can't assign requested address" * temporarily disable ipv6 test * simplify map empty judgment (#3376) * 应该是非空才循环,不然会导致在使用redis注册中心时消费者引用不到服务 (#3291) * enhance unit test and logging (#3374) * enhance unit test and logging * enhance logging message * fix unit test * make code clean * follow up for #3291 (#3378) * correct typos,eg: occured -> occurred (#3380) LGTM * follow up for #3376 (#3377) * [Dubbo-3347] Update package name in README file fix#3347 (#3362) * [Enhancement] Replace explicit resource management with try-with-resource (#3281) * first pull request (#3396) * [Dubbo-3361] Make DubboAppender extends from FileAppender (#3383) * Modify deprecated class to updated class in some comments (#3402) * Merge pull request #3341, start to use IdleStateHandler in Netty4. * Enhancement/logger factory (#3389) * polishing LoggerFactory * polishing code using map.computeIfAbsent * fix ci failure * remove unnecessary break in switch * call overloaded method * update as requested * add unit test * move construction of ConfigChangeEvent outside the lambda expression (#3398) * make ConfigChangeEvent immutable (#3403) * Fix license issues (#3382) * Fix license issues * revert change to Netty's copyright * [Dubbo-936]fix The nc command is unstable in the dubbo startup script #936 (#3375) * fix dubbo启动脚本中nc命令不稳定 #936 * modify * refactor ScriptRouter: (#3404) 1, remove priority field, the same as super class 2, remove getUrl method, the same as super class 3, refactor constructor, extract method: getRule, getEngine 4, refactor route, extract method: createBindings, getRoutedInvokers * Clean pom.xml file #3186 (#3211) * update as requested * add meta space size arguments * [Enhancement] Use ThreadLocalRandom and try-with-resource (#3239) * polish * fix code reviews * empty * polish pom.xml (remove test profile and jvm permSize args) (#3407) * update dubbo samples' link (#3413) * Acesslog dateformat enhancemnet (#3274) * #3026 Access log related changed * Reviwe comment incorporated given by @satansk and removed unuded method * Incorporated @beiwei30 review comment, incorporated common-lang3 time package modified version * Added rat entry for common lang3 FastDateFormat related java files * switch back to jdk's dateformatter * refactor loadClass method (#3410) * refactor: expression is always true, remove it (names != null && names.length > 0) * Update dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java Co-Authored-By: wanghbxxxx <[email protected]> * Update ExtensionLoader.java * Update ExtensionLoader.java * Update ExtensionLoader.java * Update ExtensionLoader.java * implement pull request #3412 on master branch (#3418) * event of response fix#3244 (#3247) * [Dubbo-3069]Use regular expressions to judge fix #3069 (#3093) * Use regular expressions to judge fix #3069 * moved into Constants class * modify * Unused import * modify * can not put it in front * catch NumberFormatException and return 'null' if necessary * remove recursive call * support .1 and 1. * modify * Support multiple shared links (#2457) * make dubbo support multiple shared links, upgrading RPC throughput * Fix compilation error * Fix compilation error * opti import * if add {} * checkstyle fail * fix getSharedClient referenceCount calculation error bug * 优化 import * Fix the problem that the getSharedClient thread is not safe * Fix the problem that the getSharedClient thread is not safe * Try fixing ci error, https://travis-ci.org/apache/incubator-dubbo/jobs/453185295 * 将DEFAULT_CONNECTIONS_KEY修改成SERVICE_CONNECTIONS_KEY * dubbo.xsd add shareconnections attribute, * Optimize code format * Fix mult connect ghost connect problem * format code * Remove the concept of ghostClientMap and ghost connection. In fact, ghostClient is LazyConnectExchangeClient. At present, the LazyConnectExchangeClient object is added directly in ReferenceCountExchangeClient to realize the mapping relationship with ReferenceCountExchangeClient. The relationship between previous ghostClient and url mapping is not applicable to the current new share. Multiple connections. * Optimize the ReferenceCountExchangeClient and remove the reference to the lazyConnectExchangeClient because it doesn't make much sense; add locks in the close operation of the AbstractClient, because connect, disconnect, and close should not be done at the same time. * format code * try remove close lock * Restore close method * Restore ReferenceCountExchangeClient reference to LazyConnectExchangeClient object * Optimize the logic of using the LazyConnectExchangeClient inside the ReferenceCountExchangeClient; Supplemental shared multi-connected unit test * remove useless catch exception (#3421) * remove duplicated import (#3440) * Update junit to 5.4.0 release version (#3441) * update junit to 5.4.0 release version * remove uesles config * remove duplicated unused method and move unit test (#3446) * Add checkstyle rule for redundant import (#3444) * add checkstyle for redundant import and fix all issue in repo * fix git diff issue * Enhance the java doc of dubbo-container module (#3437) Fixes #2994 * refactor adaptive extension class code creation: extract class AdaptiveClassCodeGenerator (#3419) * refactor adaptive extension class code creation: extract createAdaptiveExtensionClassCode to class AdaptiveClassCodeGenerator * add some comment * add license and comment * remove main method * refactor javassist compiler: extract class CtClassBuilder (#3424) * refactor JavassistCompiler * rename variable names * reformat code * refactor: prepend modifier of constructor, field and method outside the JavassistClassInfo * add null for ClassUtils.getSimpleClassName * rename JavassistClassInfo to CtClassBuilder * fix #2619: is there a problem in NettyBackedChannelBuffer.setBytes(...)? (#3448) * Bugfix/timeout queue full (#3451) replace ArrayBlockingQueue with LinkedBlockingQueue and remove capacity. * extract 2 methods: (#3453) isSetter: test if a method is a setter getSetterProperty: get property for setter, for instance setVersion return "version" * Add delay export test case (#3447) * [Dubbo-3237]fix connectionMonitor in RestProtocol seems not work #3237 (#3455) * extract method to cache default extension name (#3456) * possibly bug fix (#3460) * Merge pull request #3470, Apache parent pom version is updated to 21. * A follow up of 6058846, update apache pom version to 21 * Class comment error (#3481) * enhancement: extract duplicated method calls to variable (#3482) extract duplicated method calls to variable * [Enhancement]: language level migration (#3485) * use java7 diamond operator * replace Collections.sort with List.sort * extract duplicated code blocks * use StandardCharsets.UTF_8 * use try-with-resources * use java7 diamond operator * enhance log message * fix unit tests failures * Branch refactor version (#3471) * fix typo (#3491) * [Enhancement]: RestProtocol (#3480) * Merge pull request #3466, Condition is not properly used. fixes #1917 * fix issue#1293: A question for ReferenceConfigCache. (#3505) * [Enhancement]: refactor categorizing with Collectors.groupingBy (#3490) * Fix invocation of toString on an array (#3507) Fix invocation of toString on an array * Fix inefficient use of keySet iterator instead of entrySet iterator (#3508) Fix inefficient use of keySet iterator instead of entrySet iterator * Boolean class use method toString() instead of String.valueof() (#3495) * Merge pull request #3515, add metadataFactory SPI config for all-in-one shade jar. Fixes #3514, missing redis metadata SPI extension in dubbo.jar. * Merge pull request #3513, bump up hessian-lite version Fixes #3423. * [Dubbo-3106]Make getRegistered return unmodifiable collection. #3106 (#3425) * make getRegistered return unmodifiable collection. #3106 * fix ci failure * Merge pull request #3527 Bricks-Man/incubator-dubbo, fix accidentally check exchanger in setDispatcher fixes #3518 * Fix UT error following PR #3527 * Cache CompiledScript #390 (#3524) * Merge pull request #3532 from beiwei30:use-concurrent-map, avoid using synchronized. * Fix context filter's bug (#3526) * Modify MetadataReportRetry ThreadName (#3550) * fix: rename the thread name from DubboRegistryFailedRetryTimer to DubboMetadataReportRetryTimer in MetadataReportRetry * fix issue #3533 (#3548) * fix issue #195: @reference check=false不生效 (#3530) * Merge pull request #3528, fixes #208, setOnreturn does not work with generic invocation. * fix issue #274: monitor的cluster一定是failsafe的,而且无法修改 (#3523) * fix issue #274: monitor的cluster一定是failsafe的,而且无法修改 * remove unused import * Merge pull request #3520, fix #538 polish the process of deciding the ip to bind. * Fix npe when package is null. (#3557) * a more elegant way (#3567) * Correct security report link. * Add go implementation link. * fix DubboCodec re-implements Codec2 #2977 (#3547) * Merge pull request #3566, optimize compareTo of Router to guarantee consistent behaviour. * Merge pull request #3577, rmi support generic. Fixes #2779 * Fixes #3367, fail to parse config text with white space (#3589) * [DUBBO-3476]: NullPointerException happened when using SpringContainer.getContext() (#3600) * #3476: NullPointerException happened when using SpringContainer.getContext() * rollback change for DEFAULT_SPRING_CONFIG * replace magic string "dubbo" with constants (#3602) * dubbo-parent是头文件不包含依赖。替换成dubbo, 同时增加zk连接的依赖。因为curator-framework在dubbo-dependencies当中去除掉了zookeeper的包,所以外部使用的时候需要额外配置. (#3516) * Merge pul request #3607, introduce dubbo-dependencies-zookeeper. * Merge RestProtocolTest.java (#3597) * [DUBBO-3494]: Refactor URL to URLBuilder (#3500) * refactor URL to URLBuilder. #3494 * remove unrelated changes * replace more with URLBuilder * fix ci failure * remove unnecessary comment * Dubbo-3473 Fix Not Properly Closed Resources (#3474) * Dump TagRouterRule (#3536) Dump TagRouterRule since the TagRouterRule can be changed to `null` by ConfigCenter * Merge pull request #3578, fixes #3289, enhance tagRoute: support ip expression match. * Merge pull request #2614, follow up for issue #195. * [Dubbo-3367] Fail to parse config text with white space (#3590) * Merge pull request #3558, check if remoteGroup is empty or not. Fixes #3555. * Fluent style builder API support(#3431) (#3549) * Update maven central badge. * Merge pull request #3593, Consul support for Registry and Metadata. * [Dubbo-808] Support etcd registry (#3605) * Merge https://github.com/dubbo/dubbo-registry-etcd into incubator-dubbo * Add UT to ConfigurationUtilsTest * rename dubbo-ops to dubbo-admin (#3628) * typo for AccessLogFilter (#3633) * Fix some etcd3 registry bugs. (#3632) * fix some bugs. * fix typo * cancel keep alive if recovery failed. * remove duplicate license header. * [Dubbo-3570] repackage compatible enhancement. (#3622) * Fixes #3570, NoSuchMethodError are thrown when add custorm Filter using dubbo2.6.5 and JDK1.6 and upgrade to dubbo2.7.0 * Add compatible UT * fix UT * Replace RpcStatus to count (#2984) (#3636) * Fix when qos is disable,log will print every time. (#3397) * fix when qos is disable,log will print every time. * change qos server boos thread number 1 * add openjdk to travis (#3300) * add openjdk to travis * add openjdk to travis * Merge pull request #3647, workaround to fix #3646. * add metrics integration #3598 (#3643) * add metrics integration * add license * Merge pull request #3639, Add equivalent annotation support for MethodConfig. Fixes #2045 * Fixes #3478, #3477 and #3445 * fix heartbeat internal (#3579) * Merge pull request #3603, configcenter share zookeeper connection with registry. Fixes #3288 * correct spelling error (#3645) * make snakeyaml transitive, governance rule relies on this dependency to work. (#3659) * check null for path before call rest server (#3665) * [Dubbo-3653] etcd as config center (#3663) * Minor refactor, no functinoal change. * Separate ConnectionStateListener * Simplify code * Fix typo * Support get external config from etcd config center * Polish diamond operator * Initial etcd support as config center * Add a put interface for JEtcdClient * Enhanced Etcd config center support with the ability to watch and cancel watch * Polish code * Distinguish modification event and delete event * Add etcd registry and configcenter to dubbo-all * Watch again when connection is re-established * Polish code and fix some documentation errors (#3655) * [Dubbo-3657] Fix junit test failed (#3658) * Improve the checking of lease id. #3684 (#3692) It looks good. * Optimize DefaultTpsLimiter (#3654) * Correct @parameter config of field of ConfigCenterConfig (#3688) * fix-3678 (#3681) * Add unit test for unpack and stick pack of dubbo and telent (#3703) * fix compile error after merged master branch * remove useless imports * add AddressListener into RegistryDirectory
I am thinking of providing a fluent -style builder API built on ServiceConfig, ReferenceConfig, ...
It may work like this:
At present, one of the problems of using ServiceConfig and ReferenceConfig directly is that some application-level configurations need to be set to each ServiceConfig or ReferenceConfig, which is redundant, unnecessary and inconvenient for users
The text was updated successfully, but these errors were encountered: