[dubbo-sentinel-support] 08/11: Sync code and bump version to 1.6.0
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 751e796aecfee9c635407be67b8ab6d059e97651 Author: Eric Zhao AuthorDate: Thu Apr 25 17:10:01 2019 +0800 Sync code and bump version to 1.6.0 Signed-off-by: Eric Zhao --- README.md | 18 +-- pom.xml| 32 - .../adapter/dubbo/AbstractDubboFilter.java | 44 -- .../adapter/dubbo/DubboAppContextFilter.java | 18 +-- .../csp/sentinel/adapter/dubbo/DubboUtils.java | 25 +++- .../adapter/dubbo/SentinelDubboConsumerFilter.java | 31 +++-- .../adapter/dubbo/SentinelDubboProviderFilter.java | 35 +++-- .../dubbo/fallback/DefaultDubboFallback.java | 8 +- .../adapter/dubbo/fallback/DubboFallback.java | 9 +- .../dubbo/fallback/DubboFallbackRegistry.java | 11 +- ...ubbo.rpc.Filter => org.apache.dubbo.rpc.Filter} | 2 +- .../java/com/alibaba/csp/sentinel/BaseTest.java} | 34 ++--- .../csp/sentinel/adapter/dubbo/DemoService.java| 8 -- .../adapter/dubbo/DubboAppContextFilterTest.java | 80 +++ .../sentinel/adapter/dubbo/DubboConsumerTest.java | 74 -- .../sentinel/adapter/dubbo/DubboProviderTest.java | 32 - .../csp/sentinel/adapter/dubbo/DubboUtilsTest.java | 78 +++ .../dubbo/SentinelDubboConsumerFilterTest.java | 150 .../dubbo/SentinelDubboProviderFilterTest.java | 154 + .../dubbo/fallback/DubboFallbackRegistryTest.java | 50 +++ .../adapter/dubbo/provider/DemoService.java} | 20 +-- .../adapter/dubbo/provider/DemoServiceImpl.java| 12 -- .../dubbo/provider/impl/DemoServiceImpl.java} | 20 +-- .../resources/spring-dubbo-consumer-filter.xml | 8 +- .../resources/spring-dubbo-provider-filter.xml | 8 +- 25 files changed, 665 insertions(+), 296 deletions(-) diff --git a/README.md b/README.md index da6bd23..fe97e9f 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,23 @@ -# Sentinel Dubbo Adapter +# Sentinel Apache Dubbo Adapter -> Note: 中文文档请见[此处](https://github.com/alibaba/Sentinel/wiki/%E4%B8%BB%E6%B5%81%E6%A1%86%E6%9E%B6%E7%9A%84%E9%80%82%E9%85%8D#dubbo)。 +> Note: 中文文档请见[此处](https://github.com/alibaba/Sentinel/wiki/主流框架的适配#dubbo)。 Sentinel Dubbo Adapter provides service consumer filter and provider filter -for [Dubbo](http://dubbo.io/) services. +for [Apache Dubbo](https://dubbo.apache.org/en-us/) services. + +**Note: This adapter only supports Apache Dubbo 2.7.x and above.** For legacy `com.alibaba:dubbo` 2.6.x, +please use `sentinel-dubbo-adapter` module instead. To use Sentinel Dubbo Adapter, you can simply add the following dependency to your `pom.xml`: ```xml com.alibaba.csp -sentinel-dubbo-adapter +sentinel-apache-dubbo-adapter x.y.z ``` -> Note: currently this adapter is not compatible with Dubbo 2.7.x due to its package renaming. -We are working to support the latest Dubbo version. - The Sentinel filters are **enabled by default**. Once you add the dependency, the Dubbo services and methods will become protected resources in Sentinel, which can leverage Sentinel's flow control and guard ability when rules are configured. @@ -31,7 +31,7 @@ If you don't want the filters enabled, you can manually disable them. For exampl ``` -For more details of Dubbo filter, see [here](https://dubbo.incubator.apache.org/#/docs/dev/impls/filter.md?lang=en-us). +For more details of Dubbo filter, see [here](http://dubbo.apache.org/en-us/docs/dev/impls/filter.html). ## Dubbo resources @@ -65,4 +65,4 @@ flow control, degrade or system load protection. You can implement your own `Dub and then register to `DubboFallbackRegistry`. If no fallback is configured, Sentinel will wrap the `BlockException` then directly throw it out. -Besides, we can also leverage [Dubbo mock mechanism](http://dubbo.apache.org/#!/docs/user/demos/local-mock.md?lang=en-us) to provide fallback implementation of degraded Dubbo services. \ No newline at end of file +Besides, we can also leverage [Dubbo mock mechanism](http://dubbo.apache.org/en-us/docs/user/demos/local-mock.html) to provide fallback implementation of degraded Dubbo services. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 3ed33aa..dfd08bb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,33 +4,51 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd;> 4.0.0 - -com.alibaba.csp -sentinel-adapter -1.4.2 - -sentinel-dubbo-adapter +com.alibaba.csp +sentinel-apache-dubbo-adapter +1.6.0 jar + +1.8 +1.8 + +1.6.0 +2.7.1 + +4.12 +2.21.0 + +
[dubbo-sentinel-support] 07/11: Bump version to 1.4.2
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 5da4ee55475bfead19551754a0f7da967f05d4c5 Author: Eric Zhao AuthorDate: Wed Feb 20 14:28:29 2019 +0800 Bump version to 1.4.2 Signed-off-by: Eric Zhao --- README.md | 3 +++ pom.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76e5a32..da6bd23 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ To use Sentinel Dubbo Adapter, you can simply add the following dependency to yo ``` +> Note: currently this adapter is not compatible with Dubbo 2.7.x due to its package renaming. +We are working to support the latest Dubbo version. + The Sentinel filters are **enabled by default**. Once you add the dependency, the Dubbo services and methods will become protected resources in Sentinel, which can leverage Sentinel's flow control and guard ability when rules are configured. diff --git a/pom.xml b/pom.xml index 767d9e3..3ed33aa 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.alibaba.csp sentinel-adapter -1.3.0-GA +1.4.2 sentinel-dubbo-adapter jar
[dubbo-sentinel-support] 10/11: Update dubbo due to security issue
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 372f7871fab3bc90f971480d02ba9c948c0ec9e0 Author: Loganaden Velvindron AuthorDate: Wed Mar 15 15:51:36 2023 +0400 Update dubbo due to security issue This should properly fix CVE-2023-23638 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 51c1233..ebb7c64 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 1.8 1.6.0 -2.7.21 +2.7.22 4.12 2.21.0
[dubbo-sentinel-support] 06/11: Bump version to 1.3.0-GA
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit e9f2dabf3653a0e6bfc0f88d61f4526687d666c2 Author: Eric Zhao AuthorDate: Tue Oct 30 20:39:02 2018 +0800 Bump version to 1.3.0-GA Signed-off-by: Eric Zhao --- README.md | 2 +- pom.xml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a49a902..76e5a32 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ If the consumer does not use Sentinel Dubbo Adapter but requires flow control ba ## Global fallback -Since version 0.1.1, Sentinel Dubbo Adapter supports global fallback configuration. +Sentinel Dubbo Adapter supports global fallback configuration. The global fallback will handle exceptions and give replacement result when blocked by flow control, degrade or system load protection. You can implement your own `DubboFallback` interface and then register to `DubboFallbackRegistry`. If no fallback is configured, Sentinel will wrap the `BlockException` diff --git a/pom.xml b/pom.xml index 9ed1a2c..767d9e3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.alibaba.csp sentinel-adapter -0.1.1 +1.3.0-GA sentinel-dubbo-adapter jar @@ -31,7 +31,6 @@ com.alibaba fastjson -1.2.49 test
[dubbo-sentinel-support] 01/11: Initial commit
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit b2a32c4ee32e14ae4946274340b5dae3ba07026d Author: Ian Luo AuthorDate: Fri Jul 27 14:13:39 2018 +0800 Initial commit --- .gitignore | 23 +++ LICENSE| 201 + README.md | 1 + 3 files changed, 225 insertions(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 000..a1c2a23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,23 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce,
[dubbo-sentinel-support] 04/11: Sync update and bump version to 0.1.1
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 3d580a1784fdb862ba2d1853ea8130dc7b7f9f9f Author: Eric Zhao AuthorDate: Thu Aug 9 15:34:19 2018 +0800 Sync update and bump version to 0.1.1 Signed-off-by: Eric Zhao --- README.md| 12 pom.xml | 2 +- .../adapter/dubbo/fallback/DefaultDubboFallback.java | 1 + .../csp/sentinel/adapter/dubbo/fallback/DubboFallback.java | 1 + .../adapter/dubbo/fallback/DubboFallbackRegistry.java| 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d112457..a49a902 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Sentinel Dubbo Adapter +> Note: 中文文档请见[此处](https://github.com/alibaba/Sentinel/wiki/%E4%B8%BB%E6%B5%81%E6%A1%86%E6%9E%B6%E7%9A%84%E9%80%82%E9%85%8D#dubbo)。 + Sentinel Dubbo Adapter provides service consumer filter and provider filter for [Dubbo](http://dubbo.io/) services. @@ -51,3 +53,13 @@ so developers should manually put the application name into *attachment* at cons then extract it at provider side. Sentinel Dubbo Adapter has implemented a filter (`DubboAppContextFilter`) where consumer can carry application name information to provider automatically. If the consumer does not use Sentinel Dubbo Adapter but requires flow control based on caller, developers can manually put the application name into attachment with the key `dubboApplication`. + +## Global fallback + +Since version 0.1.1, Sentinel Dubbo Adapter supports global fallback configuration. +The global fallback will handle exceptions and give replacement result when blocked by +flow control, degrade or system load protection. You can implement your own `DubboFallback` interface +and then register to `DubboFallbackRegistry`. If no fallback is configured, Sentinel will wrap the `BlockException` +then directly throw it out. + +Besides, we can also leverage [Dubbo mock mechanism](http://dubbo.apache.org/#!/docs/user/demos/local-mock.md?lang=en-us) to provide fallback implementation of degraded Dubbo services. \ No newline at end of file diff --git a/pom.xml b/pom.xml index a7ed335..e34e9f0 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.alibaba.csp sentinel-adapter -0.1.0 +0.1.1 sentinel-dubbo-adapter jar diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DefaultDubboFallback.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DefaultDubboFallback.java index b97f703..e41b51b 100644 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DefaultDubboFallback.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DefaultDubboFallback.java @@ -23,6 +23,7 @@ import com.alibaba.dubbo.rpc.Result; /** * @author Eric Zhao + * @since 0.1.1 */ public class DefaultDubboFallback implements DubboFallback { diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallback.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallback.java index d077ee3..f529ae3 100644 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallback.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallback.java @@ -24,6 +24,7 @@ import com.alibaba.dubbo.rpc.Result; * Fallback handler for Dubbo services. * * @author Eric Zhao + * @since 0.1.1 */ public interface DubboFallback { diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallbackRegistry.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallbackRegistry.java index fe06741..9f87e61 100644 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallbackRegistry.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/fallback/DubboFallbackRegistry.java @@ -22,6 +22,7 @@ package com.alibaba.csp.sentinel.adapter.dubbo.fallback; * give fallback result in most circumstances. * * @author Eric Zhao + * @since 0.1.1 */ public final class DubboFallbackRegistry {
[dubbo-sentinel-support] 03/11: Sync update and bump version to 0.1.1
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 6865f3513183c19b778df784f936abc7eec1e2ca Author: Eric Zhao AuthorDate: Wed Aug 8 21:09:40 2018 +0800 Sync update and bump version to 0.1.1 Signed-off-by: Eric Zhao --- .../adapter/dubbo/AbstractDubboFilter.java | 15 +++ .../adapter/dubbo/DubboAppContextFilter.java | 15 +++ .../csp/sentinel/adapter/dubbo/DubboUtils.java | 15 +++ .../adapter/dubbo/SentinelDubboConsumerFilter.java | 25 ++- .../adapter/dubbo/SentinelDubboProviderFilter.java | 24 ++- .../dubbo/fallback/DefaultDubboFallback.java | 34 +++ .../adapter/dubbo/fallback/DubboFallback.java | 39 ++ .../dubbo/fallback/DubboFallbackRegistry.java | 48 ++ 8 files changed, 212 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java index 2400b3c..2c5b077 100755 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/AbstractDubboFilter.java @@ -1,3 +1,18 @@ +/* + * Copyright 1999-2018 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.alibaba.csp.sentinel.adapter.dubbo; import com.alibaba.dubbo.rpc.Filter; diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java index 36835cc..ceae979 100644 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboAppContextFilter.java @@ -1,3 +1,18 @@ +/* + * Copyright 1999-2018 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.alibaba.csp.sentinel.adapter.dubbo; import com.alibaba.dubbo.common.Constants; diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtils.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtils.java index 73fd51b..f633e9e 100644 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtils.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/DubboUtils.java @@ -1,3 +1,18 @@ +/* + * Copyright 1999-2018 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.alibaba.csp.sentinel.adapter.dubbo; import com.alibaba.dubbo.rpc.Invocation; diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java index 2f79b04..4df20d4 100755 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java @@ -1,12 +1,28 @@ +/* + * Copyright 1999-2018 Alibaba Group Holding Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the
[dubbo-sentinel-support] 11/11: Merge pull request #7 from cyberstormdotmu/master
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 910a466809371331fdaf5c16b602bca3e48666d1 Merge: 751e796 372f787 Author: Huxing Zhang AuthorDate: Tue Mar 21 12:01:39 2023 +0800 Merge pull request #7 from cyberstormdotmu/master Update dubbo to fix CVE-2023-23638 pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[dubbo-sentinel-support] 05/11: Enhance exception tracing in Sentinel Dubbo Adapter
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 73d56474a629503654ce3f216fdb58ffe0d736a7 Author: Eric Zhao AuthorDate: Wed Sep 26 14:32:29 2018 +0800 Enhance exception tracing in Sentinel Dubbo Adapter Signed-off-by: Eric Zhao --- pom.xml | 4 +--- .../csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java | 8 +++- .../csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java | 6 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index e34e9f0..9ed1a2c 100644 --- a/pom.xml +++ b/pom.xml @@ -31,10 +31,8 @@ com.alibaba fastjson -1.2.47 +1.2.49 test - - \ No newline at end of file diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java index 4df20d4..85b268d 100755 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboConsumerFilter.java @@ -57,7 +57,13 @@ public class SentinelDubboConsumerFilter extends AbstractDubboFilter implements ContextUtil.enter(resourceName); interfaceEntry = SphU.entry(invoker.getInterface().getName(), EntryType.OUT); methodEntry = SphU.entry(resourceName, EntryType.OUT); -return invoker.invoke(invocation); + +Result result = invoker.invoke(invocation); +if (result.hasException()) { +// Record common exception. +Tracer.trace(result.getException()); +} +return result; } catch (BlockException e) { return DubboFallbackRegistry.getConsumerFallback().handle(invoker, invocation, e); } catch (RpcException e) { diff --git a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java index 0eacab2..c82afb8 100755 --- a/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java +++ b/src/main/java/com/alibaba/csp/sentinel/adapter/dubbo/SentinelDubboProviderFilter.java @@ -63,7 +63,11 @@ public class SentinelDubboProviderFilter extends AbstractDubboFilter implements interfaceEntry = SphU.entry(interfaceName, EntryType.IN); methodEntry = SphU.entry(resourceName, EntryType.IN, 1, invocation.getArguments()); -return invoker.invoke(invocation); +Result result = invoker.invoke(invocation); +if (result.hasException()) { +Tracer.trace(result.getException()); +} +return result; } catch (BlockException e) { return DubboFallbackRegistry.getProviderFallback().handle(invoker, invocation, e); } catch (RpcException e) {
[dubbo-sentinel-support] 02/11: Initial commit for Sentinel Dubbo Adapter
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 3b87a01c4e1357f32d69c0daae2fd1de2ffe067c Author: Eric Zhao AuthorDate: Fri Jul 27 14:32:27 2018 +0800 Initial commit for Sentinel Dubbo Adapter Signed-off-by: Eric Zhao --- .gitignore | 43 +++-- README.md | 54 +++- pom.xml| 40 .../adapter/dubbo/AbstractDubboFilter.java | 29 + .../adapter/dubbo/DubboAppContextFilter.java | 28 .../csp/sentinel/adapter/dubbo/DubboUtils.java | 20 ++ .../adapter/dubbo/SentinelDubboConsumerFilter.java | 55 .../adapter/dubbo/SentinelDubboProviderFilter.java | 60 ++ .../META-INF/dubbo/com.alibaba.dubbo.rpc.Filter| 3 + .../csp/sentinel/adapter/dubbo/DemoService.java| 8 +++ .../sentinel/adapter/dubbo/DubboConsumerTest.java | 74 ++ .../sentinel/adapter/dubbo/DubboProviderTest.java | 32 ++ .../adapter/dubbo/provider/DemoServiceImpl.java| 12 .../resources/spring-dubbo-consumer-filter.xml | 20 ++ .../resources/spring-dubbo-provider-filter.xml | 20 ++ 15 files changed, 477 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index a1c2a23..378800f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,26 @@ -# Compiled class file -*.class +# IntelliJ project files +.idea/ +*.iml +out +gen -# Log file -*.log +# Maven +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties +!/.mvn/wrapper/maven-wrapper.jar -# BlueJ files -*.ctxt +# Eclipse +.classpath +.settings/ +.project -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* +# System related +*.DS_Store +Thumbs.db diff --git a/README.md b/README.md index 9b0be3d..d112457 100644 --- a/README.md +++ b/README.md @@ -1 +1,53 @@ -# dubbo-sentinel-support \ No newline at end of file +# Sentinel Dubbo Adapter + +Sentinel Dubbo Adapter provides service consumer filter and provider filter +for [Dubbo](http://dubbo.io/) services. + +To use Sentinel Dubbo Adapter, you can simply add the following dependency to your `pom.xml`: + +```xml + +com.alibaba.csp +sentinel-dubbo-adapter +x.y.z + +``` + +The Sentinel filters are **enabled by default**. Once you add the dependency, +the Dubbo services and methods will become protected resources in Sentinel, +which can leverage Sentinel's flow control and guard ability when rules are configured. +Demos can be found in [sentinel-demo-dubbo](https://github.com/alibaba/Sentinel/tree/master/sentinel-demo/sentinel-demo-dubbo). + +If you don't want the filters enabled, you can manually disable them. For example: + +```xml + + + +``` + +For more details of Dubbo filter, see [here](https://dubbo.incubator.apache.org/#/docs/dev/impls/filter.md?lang=en-us). + +## Dubbo resources + +The resource for Dubbo services has two granularities: service interface and service method. + +- Service interface:resourceName format is `interfaceName`,e.g. `com.alibaba.csp.sentinel.demo.dubbo.FooService` +- Service method:resourceName format is `interfaceName:methodSignature`,e.g. `com.alibaba.csp.sentinel.demo.dubbo.FooService:sayHello(java.lang.String)` + +## Flow control based on caller + +In many circumstances, it's also significant to control traffic flow based on the **caller**. +For example, assuming that there are two services A and B, both of them initiate remote call requests to the service provider. +If we want to limit the calls from service B only, we can set the `limitApp` of flow rule as the identifier of service B (e.g. service name). + +Sentinel Dubbo Adapter will automatically resolve the Dubbo consumer's *application name* as the caller's name (`origin`), +and will bring the caller's name when doing resource protection. +If `limitApp` of flow rules is not configured (`default`), flow control will take effects on all callers. +If `limitApp` of a flow rule is configured with a caller, then the corresponding flow rule will only take effect on the specific caller. + +> Note: Dubbo consumer does not provide its Dubbo application name when doing RPC, +so developers should manually put the application name into *attachment* at consumer side, +then extract it at provider side. Sentinel Dubbo Adapter has implemented a filter (`DubboAppContextFilter`) +where consumer can carry application name information to provider automatically. +If the consumer does not use Sentinel Du
[dubbo-sentinel-support] 09/11: Update dubbo to fix CVE-2023-23638
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git commit 0ce50c543ceba207fd70617454e9c416a24bfc3f Author: Loganaden Velvindron AuthorDate: Wed Mar 8 15:32:06 2023 +0400 Update dubbo to fix CVE-2023-23638 CVE report : https://www.cve.org/CVERecord?id=CVE-2023-23638 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dfd08bb..51c1233 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,7 @@ 1.8 1.6.0 -2.7.1 +2.7.21 4.12 2.21.0 @@ -52,4 +52,4 @@ test - \ No newline at end of file +
[dubbo-sentinel-support] branch master updated (751e796 -> 910a466)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-sentinel-support.git from 751e796 Sync code and bump version to 1.6.0 new 0ce50c5 Update dubbo to fix CVE-2023-23638 new 372f787 Update dubbo due to security issue new 910a466 Merge pull request #7 from cyberstormdotmu/master The 11 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[dubbo] branch master updated (bd43fa7 -> 594a68f)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from bd43fa7 [Enhancement] Improve code coverage and fix some code (#6197) add 594a68f fix the constant name in LFUCache (#7094) No new revisions were added by this update. Summary of changes: .../src/main/java/org/apache/dubbo/common/utils/LFUCache.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
[dubbo] branch master updated (ebe9de7 -> f7127c7)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from ebe9de7 update readme add f7127c7 fix comment grammar error (#7080) No new revisions were added by this update. Summary of changes: .../org/apache/dubbo/rpc/cluster/support/wrapper/AbstractCluster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
[dubbo] branch master updated: Optimize code (#7070)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 70b6fb3 Optimize code (#7070) 70b6fb3 is described below commit 70b6fb357c2a4a5aa0f593af588e9e4abd2ec05e Author: RainGan <244001...@qq.com> AuthorDate: Mon Jan 4 14:43:25 2021 +0800 Optimize code (#7070) --- .../main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java| 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java index 743551f..7c56a2a 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java @@ -232,11 +232,7 @@ public class NacosRegistry extends FailbackRegistry { * @return */ private boolean isServiceNamesWithCompatibleMode(final URL url) { -if (!isAdminProtocol(url) && createServiceName(url).isConcrete()) { -return true; -} else { -return false; -} +return !isAdminProtocol(url) && createServiceName(url).isConcrete(); } @Override
[dubbo] branch master updated: fixed broken links in (#7072)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 31424f6 fixed broken links in (#7072) 31424f6 is described below commit 31424f62aed864d70b739b2bed4582f0de694cd9 Author: changfu AuthorDate: Mon Jan 4 14:37:54 2021 +0800 fixed broken links in (#7072) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e3f0bd..2948071 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Apache Dubbo Project -[![Build Status](https://travis-ci.org/apache/dubbo.svg?branch=master)](https://travis-ci.org/apache/dubbo) +[![Build Status](https://travis-ci.com/apache/dubbo.svg?branch=master)](https://travis-ci.com/apache/dubbo) [![codecov](https://codecov.io/gh/apache/dubbo/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/dubbo) ![maven](https://img.shields.io/maven-central/v/org.apache.dubbo/dubbo.svg) ![license](https://img.shields.io/github/license/alibaba/dubbo.svg) @@ -16,7 +16,7 @@ We are now collecting Dubbo user info to help us to improve Dubbo further. Kindl ## Architecture -![Architecture](http://dubbo.apache.org/img/architecture.png) +![Architecture](https://dubbo.apache.org/imgs/architecture.png) ## Features @@ -167,7 +167,7 @@ The consumer will print out `hi, dubbo` on the screen. ### Next steps -* [Your first Dubbo application](http://dubbo.apache.org/en-us/blog/dubbo-101.html) - A 101 tutorial to reveal more details, with the same code above. +* [Your first Dubbo application](http://dubbo.apache.org/blog/2018/08/07/dubbo-101/) - A 101 tutorial to reveal more details, with the same code above. * [Dubbo user manual](http://dubbo.apache.org/docs/v2.7/user/preface/background/) - How to use Dubbo and all its features. * [Dubbo developer guide](http://dubbo.apache.org/docs/v2.7/dev/build/) - How to involve in Dubbo development. * [Dubbo admin manual](http://dubbo.apache.org/docs/v2.7/admin/install/provider-demo/) - How to admin and manage Dubbo services.
[dubbo] branch master updated: Proofread README.md file with multiple fixes (#6807)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 4a8da59 Proofread README.md file with multiple fixes (#6807) 4a8da59 is described below commit 4a8da59573cb0f1d793809439abb2f2162f2d80f Author: Addy Roy <57421832+royaditya...@users.noreply.github.com> AuthorDate: Thu Oct 15 10:03:50 2020 -0400 Proofread README.md file with multiple fixes (#6807) Fixed typo, grammatical, punctuations, and semantic coherence to improve readability and content quality. Signed-off-by: Aditya Kumar Roy --- README.md | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 153121d..d9e97d6 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ [![](https://img.shields.io/twitter/follow/ApacheDubbo.svg?label=Follow=social=0)](https://twitter.com/intent/follow?screen_name=ApacheDubbo) [![Gitter](https://badges.gitter.im/alibaba/dubbo.svg)](https://gitter.im/alibaba/dubbo?utm_source=badge_medium=badge_campaign=pr-badge) -Apache Dubbo is a high-performance, Java based open source RPC framework. Please visit [official site](http://dubbo.apache.org) for quick start and documentations, as well as [Wiki](https://github.com/apache/dubbo/wiki) for news, FAQ, and release notes. +Apache Dubbo is a high-performance, Java-based open-source RPC framework. Please visit [official site](http://dubbo.apache.org) for quick start and documentations, as well as the [wiki](https://github.com/apache/dubbo/wiki) for news, FAQ, and release notes. -We are now collecting dubbo user info in order to help us to improve Dubbo better, pls. kindly help us by providing yours on [issue#1012: Wanted: who's using dubbo](https://github.com/apache/dubbo/issues/1012), thanks :) +We are now collecting Dubbo user info to help us to improve Dubbo further. Kindly support us by supplementing your information on [issue#1012: Wanted: who's using dubbo](https://github.com/apache/dubbo/issues/1012), thanks :) ## Architecture @@ -29,14 +29,14 @@ We are now collecting dubbo user info in order to help us to improve Dubbo bette ## Getting started -The following code snippet comes from [Dubbo Samples](https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-api). You may clone the sample project and step into `dubbo-samples-api` sub directory before read on. +The following code snippet comes from [Dubbo Samples](https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-api). You may clone the sample project and step into the `dubbo-samples-api` subdirectory before proceeding. ```bash # git clone https://github.com/apache/dubbo-samples.git # cd dubbo-samples/java/dubbo-samples-api ``` -There's a [README](https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. Read it and try this sample out by following the instructions. +There's a [README](https://github.com/apache/dubbo-samples/tree/master/java/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. We recommend referencing the samples in that directory by following the below-mentioned instructions: ### Maven dependency @@ -128,7 +128,7 @@ public class Application { # mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.samples.provider.Application exec:java ``` -### Call remote service in consumer +### Call remote service in the consumer ```java package org.apache.dubbo.samples.client; @@ -174,7 +174,7 @@ The consumer will print out `hi, dubbo` on the screen. ## Building -If you want to try out the cutting-edge features, you can build with the following commands. (Java 1.8 is required to build the master branch) +If you want to try out the cutting-edge features, you can build with the following commands. (Java 1.8 is needed to build the master branch) ``` mvn clean install @@ -195,18 +195,18 @@ See [CONTRIBUTING](https://github.com/apache/dubbo/blob/master/CONTRIBUTING.md) ### How can I contribute? -* Take a look at issues with tag called [`Good first issue`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or [`Help wanted`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). -* Join the discussion on mailing list, subscription [guide](https://github.com/apache/dubbo/wiki/Mailing-list-subscription-guide). +* Take a look at issues with tags marked [`Good first issue`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or [`Help wanted`](https://github.com/apache/dubbo/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). +* Join the discussion on the mailing list, subscription [guide]
[dubbo] branch master updated (7039c98 -> 78ce240)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from 7039c98 Optimize the close and connect operations of AbstractClient (#3435) add 78ce240 Proofread CONTRIBUTING file with multiple fixes (#6805) No new revisions were added by this update. Summary of changes: CONTRIBUTING.md | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-)
[dubbo] branch master updated: [Dubbo-4765] fix demo dependencies (#4832)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 171ed25 [Dubbo-4765] fix demo dependencies (#4832) 171ed25 is described below commit 171ed255a05ef82f47bc5bacd424019004e5bb49 Author: Junjian Peng AuthorDate: Sun Aug 18 09:48:17 2019 +0800 [Dubbo-4765] fix demo dependencies (#4832) * fix demo run * add multicast --- dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/pom.xml | 8 dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/pom.xml | 8 2 files changed, 16 insertions(+) diff --git a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/pom.xml b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/pom.xml index f668a85..b277ef5 100644 --- a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/pom.xml +++ b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-consumer/pom.xml @@ -44,6 +44,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-rpc-dubbo diff --git a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/pom.xml b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/pom.xml index ff5d9ce..d8dacae 100644 --- a/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/pom.xml +++ b/dubbo-demo/dubbo-demo-api/dubbo-demo-api-provider/pom.xml @@ -46,6 +46,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-rpc-dubbo
[dubbo] branch master updated: replace hardcode with regex pattern (#4810)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 10ef042 replace hardcode with regex pattern (#4810) 10ef042 is described below commit 10ef042b697fb4d5d3b4280495eab13dee17fe4f Author: anLA7856 AuthorDate: Sat Aug 17 07:34:48 2019 +0800 replace hardcode with regex pattern (#4810) --- .../main/java/org/apache/dubbo/common/constants/CommonConstants.java | 2 ++ .../src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java index d4f0bf8..15720ac 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java @@ -54,6 +54,8 @@ public interface CommonConstants { Pattern REGISTRY_SPLIT_PATTERN = Pattern.compile("\\s*[|;]+\\s*"); +Pattern D_REGISTRY_SPLIT_PATTERN = Pattern.compile("\\s*[|]+\\s*"); + String SEMICOLON_SEPARATOR = ";"; Pattern SEMICOLON_SPLIT_PATTERN = Pattern.compile("\\s*[;]+\\s*"); diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java index 0aa009c..0755fcb 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/AbstractInterfaceConfig.java @@ -69,6 +69,7 @@ import static org.apache.dubbo.common.constants.CommonConstants.SHUTDOWN_WAIT_SE import static org.apache.dubbo.common.constants.CommonConstants.TIMESTAMP_KEY; import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_KEY; import static org.apache.dubbo.common.constants.RegistryConstants.REGISTRY_PROTOCOL; +import static org.apache.dubbo.common.constants.CommonConstants.D_REGISTRY_SPLIT_PATTERN; import static org.apache.dubbo.common.extension.ExtensionLoader.getExtensionLoader; import static org.apache.dubbo.config.Constants.DUBBO_IP_TO_REGISTRY; import static org.apache.dubbo.config.Constants.LAYER_KEY; @@ -597,7 +598,7 @@ public abstract class AbstractInterfaceConfig extends AbstractMethodConfig { String address = ConfigUtils.getProperty("dubbo.registry.address"); if (address != null && address.length() > 0) { List tmpRegistries = new ArrayList(); -String[] as = address.split("\\s*[|]+\\s*"); +String[] as = D_REGISTRY_SPLIT_PATTERN.split(address); for (String a : as) { RegistryConfig registryConfig = new RegistryConfig(); registryConfig.setAddress(a);
[dubbo-js] branch master updated: Make it subscribing all possible targets when set version to '*' or just skip it
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new d3bcd86 Make it subscribing all possible targets when set version to '*' or just skip it new 2457af4 Merge pull request #129 from jasonjoo2010/version_wildcard d3bcd86 is described below commit d3bcd861b53ff4c8ca2c079e94a0f8b8f942fdce Author: Jason Joo AuthorDate: Mon Aug 5 10:45:17 2019 +0800 Make it subscribing all possible targets when set version to '*' or just skip it --- packages/dubbo/src/registry/registry.ts | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/dubbo/src/registry/registry.ts b/packages/dubbo/src/registry/registry.ts index db6fe73..42e4c86 100644 --- a/packages/dubbo/src/registry/registry.ts +++ b/packages/dubbo/src/registry/registry.ts @@ -45,7 +45,10 @@ export default class Registry { return this._dubboServiceUrlMap .get(dubboInterface) .filter(serviceProp => { -const isSameVersion = serviceProp.version === version; +// "*" refer to default wildcard in dubbo +const isSameVersion = !version +|| version == '*' +|| serviceProp.version === version; //如果Group为null,就默认匹配, 不检查group //如果Group不为null,确保group和接口的group一致 const isSameGroup = !group || group === serviceProp.group;
[dubbo] branch master updated: Improve license check script (#4196)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 9bf51e5 Improve license check script (#4196) 9bf51e5 is described below commit 9bf51e5ec1c41a7febfad3fc28579237e849be9d Author: Huxing Zhang AuthorDate: Sun Aug 4 10:39:50 2019 +0800 Improve license check script (#4196) --- .gitignore | 2 +- licenseCheck.sh | 24 ++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8989935..1614fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,4 @@ Thumbs.db .flattened-pom.xml # license check result -license-list.txt \ No newline at end of file +license-list diff --git a/licenseCheck.sh b/licenseCheck.sh index 9992f10..a2d3565 100755 --- a/licenseCheck.sh +++ b/licenseCheck.sh @@ -3,7 +3,7 @@ APPEND_ARG="" FOLDER="./" LINE_FLAG="==" -TARGET_FILE="./license-list.txt" +TARGET_FILE="./license-list" red=`tput setaf 1` green=`tput setaf 2` @@ -57,9 +57,13 @@ missingLicense=( for i in "${missingLicense[@]}"; do search=`echo $i |awk -F: '{print $1}'` replace=`echo $i |awk -F: '{print $2}'` -sed -i -e 's/'"$search"'/'"$replace"'/g' $TARGET_FILE +sed -i.bak 's/'"$search"'/'"$replace"'/g' $TARGET_FILE done +if [ -f $TARGET_FILE.bak ]; then + rm -rf $TARGET_FILE.bak +fi + check_unknown_license=`cat $TARGET_FILE | grep "Unknown license"` #checking unknown license @@ -78,6 +82,12 @@ allowLicense=( "MIT" "The 3-Clause BSD License" "Public domain" +"JSR.*107" +"Common Public License Version 1.0" +"org.scijava:native-lib-loader" +"org.codehaus.woodstox:stax2-api" +"wsdl4j:wsdl4j" +"net.jcip:jcip-annotations" ) #filter allow license @@ -87,10 +97,12 @@ for i in "${allowLicense[@]}"; do license_need_check=`echo "$license_need_check"|grep -vi "$i"` done -if test -z "$license_need_check" -then +# remove empty lines +echo $license_need_check | sed '/^[[:space:]]*$/d' > license-need-check + +if [ ! -s license-need-check ]; then echo "${green}All dependencies license looks good${reset}" else echo "${red}Please check below license${reset}" -echo "$license_need_check" -fi \ No newline at end of file +cat license-need-check +fi
[dubbo-php-framework] 21/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 7e4b9ad7c4466c5894b789a81be1929e42b94f1e Author: wangjinxi AuthorDate: Mon Jun 24 17:18:35 2019 +0800 update --- demo/demo-consumer/config/log4php.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/demo-consumer/config/log4php.xml b/demo/demo-consumer/config/log4php.xml index 1161a1e..0b8828f 100644 --- a/demo/demo-consumer/config/log4php.xml +++ b/demo/demo-consumer/config/log4php.xml @@ -1,9 +1,9 @@ http://logging.apache.org/log4php/;> - - + - + +
[dubbo-php-framework] 27/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 9f5b5eb8804e27940fdac1cf4aabf0d968a0dcd8 Author: wangjinxi AuthorDate: Wed Jul 24 16:43:37 2019 +0800 update --- common/protocol/fsof/DubboRequest.php | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/common/protocol/fsof/DubboRequest.php b/common/protocol/fsof/DubboRequest.php index 8ec2c8e..2d64f8c 100644 --- a/common/protocol/fsof/DubboRequest.php +++ b/common/protocol/fsof/DubboRequest.php @@ -15,6 +15,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + namespace com\fenqile\fsof\common\protocol\fsof; use com\fenqile\fsof\consumer\Type; @@ -267,9 +268,14 @@ class DubboRequest public function setParams($params) { $this->params = $params; -foreach ($this->params as &$val) { -if ($val instanceof Type) { -$val = $val->object; +foreach ($this->params as &$value) { +if ($value instanceof Type) { +$value = $value->object; +} elseif (is_object($value)) { +$value = new \stdClass(); +foreach ($value as $property => $val) { +$value->$property = $val; +} } } }
[dubbo-php-framework] 24/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit c418f0b24a16868083cd71c1d25351ea13a413aa Author: wangjinxi AuthorDate: Wed Jul 17 10:17:08 2019 +0800 update --- common/file/FSOFRedis.php | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/file/FSOFRedis.php b/common/file/FSOFRedis.php index 914e0a9..42a162b 100644 --- a/common/file/FSOFRedis.php +++ b/common/file/FSOFRedis.php @@ -169,7 +169,15 @@ class FSOFRedis { if (!empty($key) && isset($this->m_redis)) { -return $this->getlRange($key); +try{ +return $this->getlRange($key); +}catch (\Exception $e){ +$this->logger->warn('redis current connect excepiton'.' |errcode:'.$e->getCode().' |errmsg:'.$e->getMessage()); +$this->close(); +//重试一次防止连接成功后,连接断开 +$this->get_redis(); +return $this->getlRange($key); +} } else {
[dubbo-php-framework] 23/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit d8e174b75b897ba211856cbe172acab8f8c8756f Author: wangjinxi AuthorDate: Tue Jul 16 13:37:23 2019 +0800 update --- composer.json | 3 ++- consumer/fsof/FSOFProcessor.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index ef301f0..dff3f4e 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,6 @@ { "require": { -"apache/log4php": "^2.3" +"apache/log4php": "^2.3", +"crazyxman/hessian-parser": "dev-master" } } diff --git a/consumer/fsof/FSOFProcessor.php b/consumer/fsof/FSOFProcessor.php index 642..e3ec2f2 100644 --- a/consumer/fsof/FSOFProcessor.php +++ b/consumer/fsof/FSOFProcessor.php @@ -320,7 +320,7 @@ class FSOFProcessor } $_data .= $tmp_data; $resv_len -= strlen($tmp_data); -} while (($resv_len > 0) && ( (microtime(true) - $start_time) > $this->iotimeout)); //读取数据不能超过设置的io时长 +} while (($resv_len > 0) && ( (microtime(true) - $start_time) < $this->iotimeout)); //读取数据不能超过设置的io时长 if ($resv_len > 0) {
[dubbo-php-framework] 03/28: add composer.json and apache/log4php replace log4php/Logger.php
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 07fae4a1cbee26307c36f27a62ac9bac694c63ff Author: kilmas AuthorDate: Fri Jun 29 13:24:05 2018 +0800 add composer.json and apache/log4php replace log4php/Logger.php --- bin/app_admin.php | 6 +- composer.json | 5 + provider/shell/StartUp.php | 10 -- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/app_admin.php b/bin/app_admin.php index 13e6dc2..57b27bd 100644 --- a/bin/app_admin.php +++ b/bin/app_admin.php @@ -17,7 +17,11 @@ * limitations under the License. */ -require_once('log4php/Logger.php'); +define("BIN_DIR", __DIR__); +define('MYROOT',BIN_DIR."/.."); + +require_once MYROOT . '/vendor/autoload.php'; +require_once MYROOT . '/vendor/apache/log4php/src/main/php/Logger.php'; use com\fenqile\fsof\common\config\FSOFConfigManager; diff --git a/composer.json b/composer.json new file mode 100644 index 000..ef301f0 --- /dev/null +++ b/composer.json @@ -0,0 +1,5 @@ +{ +"require": { +"apache/log4php": "^2.3" +} +} diff --git a/provider/shell/StartUp.php b/provider/shell/StartUp.php index fe9618c..65c9b93 100644 --- a/provider/shell/StartUp.php +++ b/provider/shell/StartUp.php @@ -17,8 +17,14 @@ */ namespace com\fenqile\fsof\provider\shell; -require_once('log4php/Logger.php'); use com\fenqile\fsof\common\config\FSOFConfigManager; +use com\fenqile\fsof\provider\core\server\TcpServer; + +define("BIN_DIR", __DIR__); +define('MYROOT',BIN_DIR."/../.."); + +require_once MYROOT . '/vendor/autoload.php'; +require_once MYROOT . '/vendor/apache/log4php/src/main/php/Logger.php'; // 定义provider shell目录 define('FSOF_PROVIDER_SHELL_PATH', __DIR__); @@ -56,7 +62,7 @@ if(isset($config['server']['log_cfg_file_path']) && !empty($config['server']['lo } \Logger::getLogger(__CLASS__)->info("input {$cmd} {$name}"); -$server = new \com\fenqile\fsof\provider\core\server\TcpServer($name); +$server = new TcpServer($name); //加载app root目录下的bootstrap.php和provider/$name.provider文件 $server->setRequire(FSOFConfigManager::getProviderAppRoot($name));
[dubbo-php-framework] 28/28: Merge pull request #22 from crazyxman/dev
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 45b1c225d5931dedc4ad3176d2b332abf1d138e1 Merge: 17d9666 9f5b5eb Author: Huxing Zhang AuthorDate: Mon Jul 29 16:02:25 2019 +0800 Merge pull request #22 from crazyxman/dev 新增hessian序列化及其他功能,功能点已列到评论处 agent/src/c/Makefile | 2 +- agent/src/c/release/agent | Bin 0 -> 476132 bytes agent/src/c/release/agent_server | Bin 0 -> 476132 bytes common/config/FSOFConstants.php | 9 +- common/file/FSOFRedis.php | 128 +++-- common/protocol/fsof/DubboParser.php | 257 +- common/protocol/fsof/DubboRequest.php | 18 ++- common/url/FSOFUrl.php| 26 composer.json | 3 +- consumer/ConsumerException.php| 16 +++ consumer/Type.php | 112 +++ consumer/fsof/FSOFProcessor.php | 52 +++ consumer/proxy/Proxy.php | 16 +-- consumer/proxy/ProxyFactory.php | 18 ++- registry/automatic/ConsumerProxy.php | 10 +- 15 files changed, 483 insertions(+), 184 deletions(-)
[dubbo-php-framework] 26/28: add Automatic identification of parameter types
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 56045c060c25faf206de0be47ed1ae57b970c7f2 Author: wangjinxi AuthorDate: Wed Jul 24 16:26:50 2019 +0800 add Automatic identification of parameter types --- common/protocol/fsof/DubboParser.php | 4 +- common/protocol/fsof/DubboRequest.php | 12 +- consumer/Type.php | 228 +- consumer/proxy/Proxy.php | 13 +- 4 files changed, 75 insertions(+), 182 deletions(-) diff --git a/common/protocol/fsof/DubboParser.php b/common/protocol/fsof/DubboParser.php index 921e912..0497f5f 100644 --- a/common/protocol/fsof/DubboParser.php +++ b/common/protocol/fsof/DubboParser.php @@ -106,7 +106,7 @@ class DubboParser } $reqData .= json_encode($request->getMethod()) . PHP_EOL; $reqData .= json_encode($this->typeRefs($request)) . PHP_EOL; -foreach (Type::getDataForSafed($request->getParams()) as $value) { +foreach ($request->getParams() as $value) { $reqData .= json_encode($value) . PHP_EOL; } $attach = array(); @@ -138,7 +138,7 @@ class DubboParser } $reqData .= $encode->encode($request->getMethod()); $reqData .= $encode->encode($this->typeRefs($request)); -foreach (Type::getDataForSafed($request->getParams()) as $value) { +foreach ($request->getParams() as $value) { $reqData .= $encode->encode($value); } $attach = ['path' => $request->getService(), 'interface' => $request->getService(), 'timeout' => $request->getTimeout()]; diff --git a/common/protocol/fsof/DubboRequest.php b/common/protocol/fsof/DubboRequest.php index cb30cb7..8ec2c8e 100644 --- a/common/protocol/fsof/DubboRequest.php +++ b/common/protocol/fsof/DubboRequest.php @@ -17,6 +17,8 @@ */ namespace com\fenqile\fsof\common\protocol\fsof; +use com\fenqile\fsof\consumer\Type; + class DubboRequest { //包头字段 @@ -89,7 +91,6 @@ class DubboRequest } - /** * @return boolean */ @@ -107,8 +108,6 @@ class DubboRequest } - - /** * @return mixed */ @@ -142,7 +141,6 @@ class DubboRequest } - /** * @return mixed */ @@ -269,6 +267,11 @@ class DubboRequest public function setParams($params) { $this->params = $params; +foreach ($this->params as &$val) { +if ($val instanceof Type) { +$val = $val->object; +} +} } /** @@ -320,7 +323,6 @@ class DubboRequest } - //用于监控service中各方法的性能 public $startTime;//开始处理请求的时间 public $endTime;//请求处理结束的时间 diff --git a/consumer/Type.php b/consumer/Type.php index 673d507..20c8123 100644 --- a/consumer/Type.php +++ b/consumer/Type.php @@ -2,8 +2,12 @@ namespace com\fenqile\fsof\consumer; +use com\fenqile\fsof\consumer\ConsumerException; +use Icecave\Collections\Collection; + class Type { +/* const SHORT = 1; const INT = 2; const INTEGER = 2; @@ -13,10 +17,13 @@ class Type const STRING = 6; const BOOL = 7; const BOOLEAN = 7; -const ARRAYLIST = 8; -const MAP = 9; +const MAP = 8; +*/ +const ARRAYLIST = 9; +const DEFAULT_TYPE = 10; const adapter = [ +/* Type::SHORT => 'S', Type::INT => 'I', Type::LONG => 'J', @@ -24,193 +31,82 @@ class Type Type::DOUBLE => 'D', Type::BOOLEAN => 'Z', Type::STRING => 'Ljava/lang/String;', +Type::MAP => 'Ljava/util/Map;', +*/ Type::ARRAYLIST => 'Ljava/util/ArrayList;', -Type::MAP => 'Ljava/util/Map;' +Type::DEFAULT_TYPE => 'Ljava/lang/Object;' ]; -public function __construct($type, $value) -{ -$this->type = $type; -$this->value = $value; -} - -/** - * Short type - * - * @param integer $value - * @return Type - */ -public static function short($value) -{ -return new self(self::SHORT, $value); -} - -/** - * Int type - * - * @param integer $value - * @return Type - */ -public static function int($value) -{ -return new self(self::INT, $value); -} - -/** - * Integer type - * - * @param integer $value - * @return Type - */ -public static function integer($value) -{ -return new self(self::INTEGER, $value); -} - -/** - * Long type - * - * @param integer $value - * @return Type - */ -public static function long($value) -{ -return new self(self::LONG, $value); -} - -/** - * Float type - * - * @param integer $valu
[dubbo-php-framework] 25/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 4f59f46d29f67d6400bcd2f2abd139d5cb2975bb Author: wangjinxi AuthorDate: Wed Jul 17 13:36:45 2019 +0800 update --- common/protocol/fsof/DubboParser.php | 11 ++- consumer/Type.php| 32 +++- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/common/protocol/fsof/DubboParser.php b/common/protocol/fsof/DubboParser.php index b812fae..921e912 100644 --- a/common/protocol/fsof/DubboParser.php +++ b/common/protocol/fsof/DubboParser.php @@ -4,6 +4,7 @@ namespace com\fenqile\fsof\common\protocol\fsof; use com\fenqile\fsof\consumer\Type; use Icecave\Flax\Serialization\Encoder; use Icecave\Flax\DubboParser as Decoder; +use com\fenqile\fsof\consumer\ConsumerException; /** * @@ -185,10 +186,10 @@ class DubboParser } else if (self::DUBBO_PROTOCOL_SERIALIZE_HESSIAN2 == $response->getSerialization()) { $this->parseResponseBodyForHessian2($response); } else { -throw new \Exception(sprintf('返回的序列化类型:(%s), 不支持解析!', $response->getSerialization())); +throw new ConsumerException(sprintf('返回的序列化类型:(%s), 不支持解析!', $response->getSerialization())); } } else { -throw new \Exception($response->getFullData()); +throw new ConsumerException($response->getFullData()); } return $response; } @@ -210,11 +211,11 @@ class DubboParser case self::RESPONSE_WITH_EXCEPTION: $exception = json_decode($content, true); if (is_array($exception) && array_key_exists('message', $exception)) { -throw new \Exception($exception['message']); +throw new ConsumerException($exception['message']); } else if (is_string($exception)) { -throw new \Exception($exception); +throw new ConsumerException($exception); } else { -throw new \Exception("provider occur error"); +throw new ConsumerException("provider occur error"); } break; default: diff --git a/consumer/Type.php b/consumer/Type.php index 3000d5b..673d507 100644 --- a/consumer/Type.php +++ b/consumer/Type.php @@ -13,6 +13,8 @@ class Type const STRING = 6; const BOOL = 7; const BOOLEAN = 7; +const ARRAYLIST = 8; +const MAP = 9; const adapter = [ Type::SHORT => 'S', @@ -21,7 +23,9 @@ class Type Type::FLOAT => 'F', Type::DOUBLE => 'D', Type::BOOLEAN => 'Z', -Type::STRING => 'Ljava/lang/String;' +Type::STRING => 'Ljava/lang/String;', +Type::ARRAYLIST => 'Ljava/util/ArrayList;', +Type::MAP => 'Ljava/util/Map;' ]; public function __construct($type, $value) @@ -130,6 +134,28 @@ class Type } /** + * Arraylist type + * + * @param arraylist $value + * @return Type + */ +public static function arrayList($value) +{ +return new self(self::ARRAYLIST, $value); +} + +/** + * Map type + * + * @param map $value + * @return Type + */ +public static function map($value) +{ +return new self(self::MAP, $value); +} + +/** * Object type * * @param integer $value @@ -176,6 +202,10 @@ class Type case Type::BOOLEAN: $value = (bool)$type->value; break; +case Type::ARRAYLIST: +case Type::MAP: +$value = (array)$type->value; +break; case Type::STRING: default: $value = (string)$type->value;
[dubbo-php-framework] 22/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit af3df5c02176b4c598ea55b147b2f7e27af60cd8 Author: wangjinxi AuthorDate: Thu Jul 4 18:26:45 2019 +0800 update --- common/file/FSOFRedis.php | 64 ++ common/protocol/fsof/DubboParser.php | 52 ++ common/url/FSOFUrl.php | 2 + config/global/conf/fsof.ini| 10 ++-- consumer/ConsumerException.php | 16 ++ consumer/Type.php | 38 - consumer/fsof/FSOFProcessor.php| 47 consumer/proxy/Proxy.php | 5 +- consumer/proxy/ProxyFactory.php| 4 +- demo/demo-consumer/config/log4php.xml | 6 +- demo/demo-consumer/consumer/demo-consumer.consumer | 10 +--- 11 files changed, 143 insertions(+), 111 deletions(-) diff --git a/common/file/FSOFRedis.php b/common/file/FSOFRedis.php index e61a8e3..914e0a9 100644 --- a/common/file/FSOFRedis.php +++ b/common/file/FSOFRedis.php @@ -22,7 +22,6 @@ use com\fenqile\fsof\common\config\FSOFConstants; class FSOFRedis { -const REDIS_TIME_OUT = 1; private static $_instance; @@ -30,7 +29,9 @@ class FSOFRedis private $logger; -private $timeout = self::REDIS_TIME_OUT; +private $connect_timeout = 1; + +private $read_timeout = 2; private $retry_count = 1; @@ -40,13 +41,14 @@ class FSOFRedis [FSOFConstants::FSOF_SERVICE_REDIS_HOST, FSOFConstants::FSOF_SERVICE_REDIS_PORT], ]; -public static function instance($config) +public static function instance($config = []) { if (extension_loaded('redis')) { if (!isset(FSOFRedis::$_instance)) { FSOFRedis::$_instance = new FSOFRedis($config); +FSOFRedis::$_instance->get_redis(); } return FSOFRedis::$_instance; } @@ -57,10 +59,10 @@ class FSOFRedis return NULL; } -public function __construct($config) +public function __construct($config = []) { $this->logger = \Logger::getLogger(__CLASS__); -if($config['redis_hosts']) +if(isset($config['redis_hosts'])) { $this->hosts = []; $address = explode(',', $config['redis_hosts']); @@ -69,20 +71,22 @@ class FSOFRedis $this->hosts[] = [$host, $port??FSOFConstants::FSOF_SERVICE_REDIS_PORT]; } } -if($config['redis_connect_timeout']) +if(isset($config['redis_connect_timeout'])) +{ +$this->connect_timeout = $config['redis_connect_timeout']; +} +if(isset($config['redis_read_timeout'])) { -$this->timeout = $config['redis_connect_timeout']; +$this->read_timeout = $config['redis_read_timeout']; } -if($config['redis_connect_type']) +if(isset($config['redis_connect_type'])) { $this->connect_type = $config['redis_connect_type']; } -if($config['redis_retry_count']) +if(isset($config['redis_retry_count'])) { $this->retry = min($config['redis_retry_count'], 1); } - -$this->get_redis(); } public function get_redis() @@ -92,24 +96,25 @@ class FSOFRedis $hosts_count = count($this->hosts); $retry = $this->retry_count; $rand_num = rand() % $hosts_count; +$ret = false; do{ try{ $redis_cli = new \Redis(); -if($this->connect_type == FSOFConstants::FSOF_SERVICE_REDIS_CONNECT_TYPE_SOCK) +if($this->connect_type == FSOFConstants::FSOF_SERVICE_REDIS_CONNECT_TYPE_TCP) { $node = $this->hosts[$rand_num]; -$ret = $redis_cli->connect($node[0],$node[1],$this->timeout); +$ret = $redis_cli->connect($node[0],$node[1],$this->connect_timeout); +$redis_cli->setOption(\Redis::OPT_READ_TIMEOUT, $this->read_timeout); $rand_num = ($rand_num + 1)%$hosts_count; if (!$ret) { $this->logger->warn("connect redis failed[{$node[0]}:{$node[1]}]"); } }else{ -$ret = $redis_cli->connect("/var/fsof/redis.sock",-1,FSOFConstants::FSOF_SERVICE_REDIS_PORT,$this->timeout); +$ret = $redis_cli-&
[dubbo-php-framework] 06/28: Merge pull request #1 from kilmas/mytest
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit fbff59558ae2926302b291e3df2f62a8980c14e6 Merge: 7fa8f97 07fae4a Author: lexinfintech <39553873+lexin-a...@users.noreply.github.com> AuthorDate: Thu Jul 5 15:31:00 2018 +0800 Merge pull request #1 from kilmas/mytest add composer.json and apache/log4php replace log4php/Logger.php bin/app_admin.php | 6 +- composer.json | 5 + provider/shell/StartUp.php | 10 -- 3 files changed, 18 insertions(+), 3 deletions(-)
[dubbo-php-framework] 10/28: Update README.md
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 3453a128cdbd8b3e1852b26fe0aa51d0cdf7063c Author: Heluwe AuthorDate: Tue Aug 28 12:04:30 2018 +0800 Update README.md --- README.md | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 4d04984..07977e3 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,5 @@ - provider_admin is deployed on all provider machines to control the lifecycle of all php providers on that machine. http://www.w3school.com.cn;>Quick start -a {text-decoration:none} - - - -[img1]:data:image/png;base64,iVBORw0KGgoNSUhEUgAAA/8AAAGCCAYAAAC2IXNgAXNSR0IArs4c6QRnQU1BAACxjwv8YQUJcEhZcwAAEnQAABJ0Ad5mH3gAAMuRSURBVHhe7N0FnBxF2gbwN+uSlWyy2bi7hwgxJIHgfriGww9L4MPd4eAIcOihweHww0MSiJAQhbi7bzZZybp9/dR0zdbM9szOblZnn39+lelp756e2X6rqqualFqEiIiIiIiIiIJWiP1KREREREREREGKwT8RERERERFRkGPwT0RERERERBTkGPwTERERERERBTkG/0RERERERERBjsE/ERERERERUZBj8E9EREREREQU5Bj8ExEREREREQU5Bv9EREREREREQY7BPxEREREREVGQY/BPREREREREFOQY/BMREREREREFOQb/REREREREREGOwT8RERERERFRkGPwT0RERER [...] - - - +![image](https://github.com/lexin-fintech/dubbo-php-framework/blob/master/arch.png)
[dubbo-php-framework] 11/28: Update README.md
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 30ffe33ec3c2e660c58980d1dfee1022dcfc1080 Author: Heluwe AuthorDate: Tue Aug 28 12:05:12 2018 +0800 Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 07977e3..5e53b45 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ dubbo-php-framework is a RPC communication framework for PHP language. It is fully compatible with Dubbo protocol, and can be used as provider terminal and consumer terminal simultaneously. Using zookeeper for service registration discovery, and using fastjson for Serialization. -![alt][img1] +![image](https://github.com/lexin-fintech/dubbo-php-framework/blob/master/arch.png) ## Introduction - php provider runs in multiple processes. The worker process is used to process specific business, the manager process controls the lifecycle of the worker process, and the master process processes the network IO. @@ -13,4 +13,4 @@ http://www.w3school.com.cn;>Quick start -![image](https://github.com/lexin-fintech/dubbo-php-framework/blob/master/arch.png) +
[dubbo-php-framework] 01/28: Initial commit
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit f12765b8da6e56b590f09efe56ad88adb286b70d Author: lexinfintech <39553873+lexin-a...@users.noreply.github.com> AuthorDate: Thu Jun 28 16:25:17 2018 +0800 Initial commit --- LICENSE | 201 1 file changed, 201 insertions(+) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) p
[dubbo-php-framework] 08/28: Merge pull request #4 from comdeng/patch-1
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit b50e99707187383501c7d21b90b8f2192ddf327d Merge: fbff595 481c096 Author: lexinfintech <39553873+lexin-a...@users.noreply.github.com> AuthorDate: Wed Jul 18 16:20:31 2018 +0800 Merge pull request #4 from comdeng/patch-1 correct wrong word README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
[dubbo-php-framework] 19/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit b1479a67b27740d74bc1683748b39be7256092ab Author: wangjinxi AuthorDate: Thu Jun 20 17:31:24 2019 +0800 update --- common/protocol/fsof/DubboParser.php | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/common/protocol/fsof/DubboParser.php b/common/protocol/fsof/DubboParser.php index 7dbba4f..d939b07 100644 --- a/common/protocol/fsof/DubboParser.php +++ b/common/protocol/fsof/DubboParser.php @@ -72,10 +72,10 @@ class DubboParser public function packRequest(DubboRequest $request) { if (self::DUBBO_PROTOCOL_SERIALIZE_HESSIAN2 == self::DUBBO_PROTOCOL_NAME_MAP_CODE[$request->getSerialization()]) { -$reqData = $this->buildHessian2Body($request); +$reqData = $this->buildBodyForHessian2($request); $serialize_type = self::DUBBO_PROTOCOL_SERIALIZE_HESSIAN2; } else { -$reqData = $this->buildFastJsonBody($request); +$reqData = $this->buildBodyForFastJson($request); $serialize_type = self::DUBBO_PROTOCOL_SERIALIZE_FAST_JSON; } $upper = ($request->getSn() & self::UPPER_MASK) >> 32; @@ -93,7 +93,7 @@ class DubboParser return $out . $reqData; } -public function buildFastJsonBody(DubboRequest $request) +public function buildBodyForFastJson(DubboRequest $request) { $reqData = json_encode($request->getDubboVersion()) . PHP_EOL . json_encode($request->getService()) . PHP_EOL; @@ -128,7 +128,7 @@ class DubboParser } -public function buildHessian2Body(DubboRequest $request) +public function buildBodyForHessian2(DubboRequest $request) { $hess_stream = new \HessianStream(); $hess_options = new \HessianOptions(); @@ -193,7 +193,7 @@ class DubboParser { if (DubboResponse::OK == $response->getStatus()) { if (self::DUBBO_PROTOCOL_SERIALIZE_FAST_JSON == $response->getSerialization()) { -$this->parseResponseBodyForFastjson($response); +$this->parseResponseBodyForFastJson($response); } else if (self::DUBBO_PROTOCOL_SERIALIZE_HESSIAN2 == $response->getSerialization()) { $this->parseResponseBodyForHessian2($response); } else { @@ -205,7 +205,7 @@ class DubboParser return $response; } -private function parseResponseBodyForFastjson(DubboResponse $response) +private function parseResponseBodyForFastJson(DubboResponse $response) { $_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN); $response->setResponseBody($_data); @@ -238,14 +238,16 @@ class DubboParser private function parseResponseBodyForHessian2(DubboResponse $response) { -$_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN + 1); -$response->setResponseBody($_data); -$hess_stream = new \HessianStream($_data); -$hess_options = new \HessianOptions(); -$hess_factory = new \HessianFactory(); -$parser = $hess_factory->getParser($hess_stream, $hess_options); -$content = $parser->parseReply(); -$response->setResult($content); +if (!$response->isHeartbeatEvent()) { +$_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN + 1); +$response->setResponseBody($_data); +$hess_stream = new \HessianStream($_data); +$hess_options = new \HessianOptions(); +$hess_factory = new \HessianFactory(); +$parser = $hess_factory->getParser($hess_stream, $hess_options); +$content = $parser->parseReply(); +$response->setResult($content); +} return $response; }
[dubbo-php-framework] 15/28: Update README.md
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 17d9666ee2f2c79d2b29f1804ff0259861bd793c Author: Ian Luo AuthorDate: Thu Apr 25 10:45:53 2019 +0800 Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0f2fd25..aa4361b 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ - php consumer、redis and agent are deployed on all consumer machines and communicate with each other on unix socket. - provider_admin is deployed on all provider machines to control the lifecycle of all php providers on that machine. -https://github.com/dubbo/dubbo-php-framework/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B;>Quick start (Chinese) -https://github.com/dubbo/dubbo-php-framework/wiki/%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC;>Installation guide (Chinese) -https://github.com/dubbo/dubbo-php-framework/wiki/%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83%E6%89%8B%E5%86%8C;>Configuration guide (Chinese) +https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B;>Quick start (Chinese) +https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC;>Installation guide (Chinese) +https://github.com/dubbo/php-framework-for-apache-dubbo/wiki/%E9%85%8D%E7%BD%AE%E5%8F%82%E8%80%83%E6%89%8B%E5%86%8C;>Configuration guide (Chinese)
[dubbo-php-framework] 12/28: Merge pull request #7 from Heluwe/baiji_team8_dubo-php
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 757558f266fb0507ade53905e452fc977b284712 Merge: b50e997 30ffe33 Author: ken.lj AuthorDate: Mon Sep 3 10:45:36 2018 +0800 Merge pull request #7 from Heluwe/baiji_team8_dubo-php README.md | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-)
[dubbo-php-framework] 05/28: Merge pull request #2 from pengmingming/master
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 7fa8f974cb6ce0bd2719463de098a998d11b2e05 Merge: e8ad247 30c9b5e Author: lexinfintech <39553873+lexin-a...@users.noreply.github.com> AuthorDate: Thu Jul 5 15:27:31 2018 +0800 Merge pull request #2 from pengmingming/master Fix bin/app_admin.php | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-)
[dubbo-php-framework] 07/28: correct wrong word
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 481c09667ceda00be4498cbefc330b2abc05dbb6 Author: comdeng AuthorDate: Thu Jul 12 16:51:03 2018 +0800 correct wrong word --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7e0c38e..e5e4308 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ dubbo-php-framework是一个用于php语言的RPC通讯框架,与dubbo在协 ## 说明 * php provider以多进程方式运行,其中worker进程用于处理具体业务,manager进程控制worker进程的生命周期,master进程处理网络IO. * agent监听registry中provider地址信息的变更并同步到本地redis,供本机上所有php consumer共享. -* php consumer、redis、angent三者部署在所有consumer机器上,并且彼此以unix socket通信. +* php consumer、redis、agent三者部署在所有consumer机器上,并且彼此以unix socket通信. * provider_admin部署在所有provider机器上,用于控制该机器上所有php provider的生命周期. -[Quick start](https://github.com/lexin-fintech/dubbo-php-framework/wiki/Quick-Start) \ No newline at end of file +[Quick start](https://github.com/lexin-fintech/dubbo-php-framework/wiki/Quick-Start)
[dubbo-php-framework] 09/28: translate readme.md to english
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 69ef01bfb7b6d2eae2765d750e30bba9d2fc1212 Author: xly AuthorDate: Tue Aug 28 12:00:49 2018 +0800 translate readme.md to english --- README.md | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e5e4308..4d04984 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,23 @@ -# dubbo-php-framework -dubbo-php-framework是一个用于php语言的RPC通讯框架,与dubbo在协议上完全兼容,可同时作为provider端和consumer端,使用zookeeper用于服务注册发现,序列化使用fastjson. +## dubbo-php-framework + + +dubbo-php-framework is a RPC communication framework for PHP language. It is fully compatible with Dubbo protocol, and can be used as provider terminal and consumer terminal simultaneously. Using zookeeper for service registration discovery, and using fastjson for Serialization. + +![alt][img1] + +## Introduction +- php provider runs in multiple processes. The worker process is used to process specific business, the manager process controls the lifecycle of the worker process, and the master process processes the network IO. +- Agent monitors the change of provider address information in registry and synchronizes them to local redis for all php consumers on the machine to share. +- php consumer、redis and agent are deployed on all consumer machines and communicate with each other on unix socket. +- provider_admin is deployed on all provider machines to control the lifecycle of all php providers on that machine. + +http://www.w3school.com.cn;>Quick start +a {text-decoration:none} + + + +[img1]:data:image/png;base64,iVBORw0KGgoNSUhEUgAAA/8AAAGCCAYAAAC2IXNgAXNSR0IArs4c6QRnQU1BAACxjwv8YQUJcEhZcwAAEnQAABJ0Ad5mH3gAAMuRSURBVHhe7N0FnBxF2gbwN+uSlWyy2bi7hwgxJIHgfriGww9L4MPd4eAIcOihweHww0MSiJAQhbi7bzZZybp9/dR0zdbM9szOblZnn39+lelp756e2X6rqqualFqEiIiIiIiIiIJWiP1KREREREREREGKwT8RERERERFRkGPwT0RERERERBTkGPwTERERERERBTkG/0RERERERERBjsE/ERERERERUZBj8E9EREREREQU5Bj8ExEREREREQU5Bv9EREREREREQY7BPxEREREREVGQY/BPREREREREFOQY/BMREREREREFOQb/REREREREREGOwT8RERERERFRkGPwT0RERER [...] -![image](https://github.com/lexin-fintech/dubbo-php-framework/blob/master/arch.png) -## 说明 -* php provider以多进程方式运行,其中worker进程用于处理具体业务,manager进程控制worker进程的生命周期,master进程处理网络IO. -* agent监听registry中provider地址信息的变更并同步到本地redis,供本机上所有php consumer共享. -* php consumer、redis、agent三者部署在所有consumer机器上,并且彼此以unix socket通信. -* provider_admin部署在所有provider机器上,用于控制该机器上所有php provider的生命周期. -[Quick start](https://github.com/lexin-fintech/dubbo-php-framework/wiki/Quick-Start)
[dubbo-php-framework] 04/28: Fix
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 30c9b5ef3f4a1273deaf483dfc10f7ff43a74607 Author: pengmingming AuthorDate: Thu Jul 5 15:17:54 2018 +0800 Fix --- bin/app_admin.php | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bin/app_admin.php b/bin/app_admin.php index 13e6dc2..131ca6b 100644 --- a/bin/app_admin.php +++ b/bin/app_admin.php @@ -92,11 +92,14 @@ else echo "app_admin.php $cmd".PHP_EOL; } -$config = FSOFConfigManager::getProviderAppDeploy($name); -if(isset($config['server']['log_cfg_file_path']) && !empty($config['server']['log_cfg_file_path'])) +if (!empty($name)) { -\Logger::configure($config['server']['log_cfg_file_path']); -date_default_timezone_set('PRC'); + $config = FSOFConfigManager::getProviderAppDeploy($name); + if(isset($config['server']['log_cfg_file_path']) && !empty($config['server']['log_cfg_file_path'])) + { + \Logger::configure($config['server']['log_cfg_file_path']); + date_default_timezone_set('PRC'); + } } //执行所有的控制命令
[dubbo-php-framework] 18/28: update
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit 07c8555cdc4e7b06d7047bfe370d70c533bd3ff8 Author: wangjinxi AuthorDate: Thu Jun 20 16:03:33 2019 +0800 update --- common/protocol/fsof/DubboParser.php | 79 ++-- 1 file changed, 49 insertions(+), 30 deletions(-) diff --git a/common/protocol/fsof/DubboParser.php b/common/protocol/fsof/DubboParser.php index f820851..7dbba4f 100644 --- a/common/protocol/fsof/DubboParser.php +++ b/common/protocol/fsof/DubboParser.php @@ -191,45 +191,64 @@ class DubboParser public function parseResponseBody(DubboResponse $response) { -$_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN); -$response->setResponseBody($_data); if (DubboResponse::OK == $response->getStatus()) { if (self::DUBBO_PROTOCOL_SERIALIZE_FAST_JSON == $response->getSerialization()) { -list($status, $content) = explode(PHP_EOL, $_data); -switch ($status) { -case self::RESPONSE_NULL_VALUE: -break; -case self::RESPONSE_VALUE: -$response->setResult(json_decode($content, true)); -break; -case self::RESPONSE_WITH_EXCEPTION: -$exception = json_decode($content, true); -if (is_array($exception) && array_key_exists('message', $exception)) { -throw new \Exception($exception['message']); -} else if (is_string($exception)) { -throw new \Exception($exception); -} else { -throw new \Exception("provider occur error"); -} -break; -default: -return false; -} +$this->parseResponseBodyForFastjson($response); } else if (self::DUBBO_PROTOCOL_SERIALIZE_HESSIAN2 == $response->getSerialization()) { -$_data = substr($_data, 1); -$hess_stream = new \HessianStream($_data); -$hess_options = new \HessianOptions(); -$hess_factory = new \HessianFactory(); -$parser = $hess_factory->getParser($hess_stream, $hess_options); -$content = $parser->parseReply(); -$response->setResult($content); +$this->parseResponseBodyForHessian2($response); +} else { +throw new \Exception(sprintf('返回的序列化类型:(%s), 不支持解析!', $response->getSerialization())); } } else { -throw new \Exception($_data); +throw new \Exception($response->getFullData()); +} +return $response; +} + +private function parseResponseBodyForFastjson(DubboResponse $response) +{ +$_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN); +$response->setResponseBody($_data); +list($status, $content) = explode(PHP_EOL, $_data); +if ($response->isHeartbeatEvent()) { +$response->setResult(json_decode($status, true)); +} else { +switch ($status) { +case self::RESPONSE_NULL_VALUE: +break; +case self::RESPONSE_VALUE: +$response->setResult(json_decode($content, true)); +break; +case self::RESPONSE_WITH_EXCEPTION: +$exception = json_decode($content, true); +if (is_array($exception) && array_key_exists('message', $exception)) { +throw new \Exception($exception['message']); +} else if (is_string($exception)) { +throw new \Exception($exception); +} else { +throw new \Exception("provider occur error"); +} +break; +default: +return false; +} } return $response; } +private function parseResponseBodyForHessian2(DubboResponse $response) +{ +$_data = substr($response->getFullData(), self::PACKAGE_HEDA_LEN + 1); +$response->setResponseBody($_data); +$hess_stream = new \HessianStream($_data); +$hess_options = new \HessianOptions(); +$hess_factory = new \HessianFactory(); +$parser = $hess_factory->getParser($hess_stream, $hess_options); +$content = $parser->parseReply(); +$response->setResult($content); +return $response; +} + public function parseRequestHeader(DubboRequest &$request) {
[dubbo-php-framework] 14/28: Update README.md
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git commit d7a40a1a0fb44237ed772e5b310d0552df868594 Author: Ian Luo AuthorDate: Thu Apr 25 10:44:40 2019 +0800 Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b3d647e..0f2fd25 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -## dubbo-php-framework +## php framework for apache dubbo -dubbo-php-framework is a RPC communication framework for PHP language. It is fully compatible with Dubbo protocol, and can be used as provider terminal and consumer terminal simultaneously. Using zookeeper for service registration discovery, and using fastjson for Serialization. +php-for-apache-dubbo is a RPC communication framework for PHP language. It is fully compatible with Dubbo protocol, and can be used as provider terminal and consumer terminal simultaneously. Using zookeeper for service registration discovery, and using fastjson for Serialization. ![image](https://github.com/lexin-fintech/dubbo-php-framework/blob/master/arch.png)
[dubbo-php-framework] branch master updated (17d9666 -> 45b1c22)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-php-framework.git. from 17d9666 Update README.md new 1c33271 update new 0c27efd update new 07c8555 update new b1479a6 update new c726875 update new 7e4b9ad update new af3df5c update new d8e174b update new c418f0b update new 4f59f46 update new 56045c0 add Automatic identification of parameter types new 9f5b5eb update new 45b1c22 Merge pull request #22 from crazyxman/dev The 28 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: agent/src/c/Makefile | 2 +- agent/src/c/release/agent | Bin 0 -> 476132 bytes agent/src/c/release/agent_server | Bin 0 -> 476132 bytes common/config/FSOFConstants.php | 9 +- common/file/FSOFRedis.php | 128 +++-- common/protocol/fsof/DubboParser.php | 257 +- common/protocol/fsof/DubboRequest.php | 18 ++- common/url/FSOFUrl.php| 26 composer.json | 3 +- consumer/ConsumerException.php| 16 +++ consumer/Type.php | 112 +++ consumer/fsof/FSOFProcessor.php | 52 +++ consumer/proxy/Proxy.php | 16 +-- consumer/proxy/ProxyFactory.php | 18 ++- registry/automatic/ConsumerProxy.php | 10 +- 15 files changed, 483 insertions(+), 184 deletions(-) create mode 100755 agent/src/c/release/agent create mode 100755 agent/src/c/release/agent_server create mode 100644 consumer/ConsumerException.php create mode 100644 consumer/Type.php
[dubbo-website] branch master updated: Fix wrong description about dubbo:registry#371 (#435)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-website.git The following commit(s) were added to refs/heads/master by this push: new 3d9e440 Fix wrong description about dubbo:registry#371 (#435) 3d9e440 is described below commit 3d9e4400b53fe36f782b289817ef9197d0b5f010 Author: 天璇 AuthorDate: Tue Jul 23 11:35:49 2019 +0800 Fix wrong description about dubbo:registry#371 (#435) --- docs/en-us/user/references/xml/dubbo-reference.md | 6 ++ docs/en-us/user/references/xml/dubbo-registry.md | 11 ++- docs/zh-cn/user/references/xml/dubbo-registry.md | 8 +++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/en-us/user/references/xml/dubbo-reference.md b/docs/en-us/user/references/xml/dubbo-reference.md index 85bb55a..a91d350 100644 --- a/docs/en-us/user/references/xml/dubbo-reference.md +++ b/docs/en-us/user/references/xml/dubbo-reference.md @@ -1,3 +1,9 @@ +--- +title: dubbo:reference +keywords: dubbo,reference +description: dubbo:reference +--- + # dubbo:reference The configuration of service consumer. The corresponding class is`org.apache.dubbo.config.ReferenceConfig` diff --git a/docs/en-us/user/references/xml/dubbo-registry.md b/docs/en-us/user/references/xml/dubbo-registry.md index 3071802..2e74136 100644 --- a/docs/en-us/user/references/xml/dubbo-registry.md +++ b/docs/en-us/user/references/xml/dubbo-registry.md @@ -1,3 +1,9 @@ +--- +title: dubbo:registry +keywords: dubbo,registry +description: dubbo:registry +--- + # dubbo:registry The configuration of the registry center. The corresponding class is `org.apache.dubbo.config.RegistryConfig`. If you have multiple different registries, you can declare multiple `` tags, and then reference specified registry with `registry` property in `` or `` tag. @@ -14,8 +20,11 @@ The configuration of the registry center. The corresponding class is `org.apache | timeout | registry.timeout| int | False | 5000 | Performance optimize | The timeout(ms) of the request to registry. | Above 2.0.0 | | session | registry.session| int | False | 6 | Performance optimize | The session timeout(ms) of the registry. It's used to check whether the providers are alive. It depends on the implement of the registry. For example, for HeartBeat implement, the timeout is the interval of two heart beats. | Above 2.1.0 | | file | registry.file | string | False | | Service governance| The local file to cache the address list of registries and providers. When application restarts, it will restore the registries and providers. Please use different file for different registy. | Above 2.0.0 | +| wait | registry.wait | int | False | 0 | Performance optimize | Stop wait for a notice completion time (ms) | Above 2.0.0 | | check | check | boolean | False | true | Service governance| Whether throwing exception while the registry isn't existed. | Above 2.0.0 | | register | register| boolean | False | true | Service governance| whether registering to the registry center. If false, just subscribing, not registering. | Above 2.0.5 | | subscribe | subscribe | boolean | False | true | Service governance| whether subscribing from the registry center. If false, just registering, not subscribing. | Above 2.0.5 | | dynamic | dynamic | boolean | False | true | Service governance| Whether the service is registered dynamically. If false, services will be showed as `disable`, you need to enable it manually. And you also need to disable it when provider shut down. | Above 2.0.5 | -| group | group | string | False | dubbo | Service governance | Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation. | Above 2.0.5 | +| group | group | string | False | dubbo | Service governance| Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation. | Above 2.0.5 | +| simplified| simplified | boolean | False | false | Service governance| Registered with the registry URL whether to adopt the lean mode (compatible with low version) | Above 2.7.0 | +| extra-keys| extraKeys | string | False | | Service governance| In simplified = true, extraKeys allows you to outside the default arguments put additional key in the URL, format: "inte
[dubbo-js] branch master updated: dubbo.subcribe -> .dubbo.subscribe
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new f08c746 dubbo.subcribe -> .dubbo.subscribe new 1f87fb3 Merge pull request #125 from wushanchao/patch-1 f08c746 is described below commit f08c74689a9451a175004182ab94276ccc7bb508 Author: sam AuthorDate: Fri Jul 19 14:55:50 2019 +0800 dubbo.subcribe -> .dubbo.subscribe 函数名写错了,少了个s --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index 1bd76e4..e15fff5 100644 --- a/docs/api.md +++ b/docs/api.md @@ -123,7 +123,7 @@ const dubbo = Dubbo.from(/*...*/); ```javascript const dubbo = Dubbo.from(/*...*/); -dubbo.subcribe({ +dubbo.subscribe({ onTrace(msg: ITrace) { console.log(msg); },
[dubbo] branch master updated: follow up for pr#4339, remove the space (#4591)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new b4afeb9 follow up for pr#4339, remove the space (#4591) b4afeb9 is described below commit b4afeb982b943ca8c6bbd261302a9e161c2e98a9 Author: Ian Luo AuthorDate: Thu Jul 18 09:44:03 2019 +0800 follow up for pr#4339, remove the space (#4591) --- .../extension/AdaptiveClassCodeGenerator.java | 84 +++--- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGenerator.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGenerator.java index 239f862..610534f 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGenerator.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGenerator.java @@ -31,56 +31,56 @@ import org.apache.dubbo.common.utils.StringUtils; * Code generator for Adaptive class */ public class AdaptiveClassCodeGenerator { - + private static final Logger logger = LoggerFactory.getLogger(AdaptiveClassCodeGenerator.class); private static final String CLASSNAME_INVOCATION = "org.apache.dubbo.rpc.Invocation"; - + private static final String CODE_PACKAGE = "package %s;\n"; - + private static final String CODE_IMPORTS = "import %s;\n"; - + private static final String CODE_CLASS_DECLARATION = "public class %s$Adaptive implements %s {\n"; - + private static final String CODE_METHOD_DECLARATION = "public %s %s(%s) %s {\n%s}\n"; - + private static final String CODE_METHOD_ARGUMENT = "%s arg%d"; - + private static final String CODE_METHOD_THROWS = "throws %s"; - + private static final String CODE_UNSUPPORTED = "throw new UnsupportedOperationException(\"The method %s of interface %s is not adaptive method!\");\n"; - + private static final String CODE_URL_NULL_CHECK = "if (arg%d == null) throw new IllegalArgumentException(\"url == null\");\n%s url = arg%d;\n"; - + private static final String CODE_EXT_NAME_ASSIGNMENT = "String extName = %s;\n"; - + private static final String CODE_EXT_NAME_NULL_CHECK = "if(extName == null) " + "throw new IllegalStateException(\"Failed to get extension (%s) name from url (\" + url.toString() + \") use keys(%s)\");\n"; - + private static final String CODE_INVOCATION_ARGUMENT_NULL_CHECK = "if (arg%d == null) throw new IllegalArgumentException(\"invocation == null\"); " + "String methodName = arg%d.getMethodName();\n"; - - + + private static final String CODE_EXTENSION_ASSIGNMENT = "%s extension = (% type; - + private String defaultExtName; - + public AdaptiveClassCodeGenerator(Class type, String defaultExtName) { this.type = type; this.defaultExtName = defaultExtName; } - + /** * test if given type has at least one method annotated with SPI */ private boolean hasAdaptiveMethod() { return Arrays.stream(type.getMethods()).anyMatch(m -> m.isAnnotationPresent(Adaptive.class)); } - + /** * generate and return class code */ @@ -94,13 +94,13 @@ public class AdaptiveClassCodeGenerator { code.append(generatePackageInfo()); code.append(generateImports()); code.append(generateClassDeclaration()); - + Method[] methods = type.getMethods(); for (Method method : methods) { code.append(generateMethod(method)); } code.append("}"); - + if (logger.isDebugEnabled()) { logger.debug(code.toString()); } @@ -127,18 +127,18 @@ public class AdaptiveClassCodeGenerator { private String generateClassDeclaration() { return String.format(CODE_CLASS_DECLARATION, type.getSimpleName(), type.getCanonicalName()); } - + /** - * generate method not annotated with Adaptive with throwing unsupported exception + * generate method not annotated with Adaptive with throwing unsupported exception */ private String generateUnsupported(Method method) { return String.format(CODE_UNSUPPORTED, method, type.getName()); } - + /** * get index of parameter with type URL */ -private int getUrlTypeIndex(Method method) { +private int getUrlTypeIndex(Method method) { int urlTypeIndex = -1; Class[] pts = method.getParameterTypes();
[dubbo] branch master updated: Make code strong, version check compatibility. Fix https://github.com/apache/dubbo/pull/4488 (#4490)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 363cd0c Make code strong, version check compatibility. Fix https://github.com/apache/dubbo/pull/4488 (#4490) 363cd0c is described below commit 363cd0c36bac074db1e2a00c368b57e5d2f22891 Author: ken.lj AuthorDate: Tue Jul 16 16:57:03 2019 +0800 Make code strong, version check compatibility. Fix https://github.com/apache/dubbo/pull/4488 (#4490) --- .../src/main/java/org/apache/dubbo/common/Version.java | 17 + .../org/apache/dubbo/common/version/VersionTest.java| 6 ++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java b/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java index b67d32c..8494fed 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java @@ -42,6 +42,8 @@ public final class Version { // Dubbo RPC protocol version, for compatibility, it must not be between 2.0.10 ~ 2.6.2 public static final String DEFAULT_DUBBO_PROTOCOL_VERSION = "2.0.2"; +// version 1.0.0 represents Dubbo rpc protocol before v2.6.2 +public static final int LEGACY_DUBBO_PROTOCOL_VERSION = 1; // 1.0.0 // Dubbo implementation version, usually is jar version. private static final String VERSION = getVersion(Version.class, ""); @@ -115,10 +117,17 @@ public final class Version { public static int getIntVersion(String version) { Integer v = VERSION2INT.get(version); if (v == null) { -v = parseInt(version); -// e.g., version number 2.6.3 will convert to 2060300 -if (version.split("\\.").length == 3) { -v = v * 100; +try { +v = parseInt(version); +// e.g., version number 2.6.3 will convert to 2060300 +if (version.split("\\.").length == 3) { +v = v * 100; +} +} catch (Exception e) { +logger.warn("Please make sure your version value has the right format: " + +"\n 1. only contains digital number: 2.0.0; \n 2. with string suffix: 2.6.7-stable. " + +"\nIf you are using Dubbo before v2.6.2, the version value is the same with the jar version."); +v = LEGACY_DUBBO_PROTOCOL_VERSION; } VERSION2INT.put(version, v); } diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java index 419e5d8..19eea4d 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java @@ -34,6 +34,12 @@ public class VersionTest { Assertions.assertTrue(Version.isSupportResponseAttachment("2.0.2")); Assertions.assertTrue(Version.isSupportResponseAttachment("2.0.3")); Assertions.assertFalse(Version.isSupportResponseAttachment("2.0.0")); +Assertions.assertFalse(Version.isSupportResponseAttachment("1.0.0")); + Assertions.assertTrue(Version.isSupportResponseAttachment("2.6.6-stable")); + + Assertions.assertFalse(Version.isSupportResponseAttachment("2.0.contains")); + Assertions.assertFalse(Version.isSupportResponseAttachment("version.string")); + Assertions.assertFalse(Version.isSupportResponseAttachment("prefix2.0")); } @Test
[dubbo] branch 2.7.3-release updated: unify config-center model (#4388)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch 2.7.3-release in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/2.7.3-release by this push: new c4e9495 unify config-center model (#4388) c4e9495 is described below commit c4e94958fd886994d2dfb78f28f0a77c52a5e7e7 Author: ken.lj AuthorDate: Thu Jul 4 17:20:38 2019 +0800 unify config-center model (#4388) * unify config-center model * change ut to meet the new model * add back the wrongly deleted line --- .../router/condition/config/ListenableRouter.java | 2 +- .../router/condition/config/ServiceRouter.java | 2 +- .../dubbo/rpc/cluster/router/tag/TagRouter.java| 4 +- .../src/main/java/org/apache/dubbo/common/URL.java | 33 + .../dubbo/common/constants/CommonConstants.java| 2 + .../test/java/org/apache/dubbo/common/URLTest.java | 15 ++ .../dubbo/config/AbstractInterfaceConfig.java | 24 +- .../dubbo/configcenter/DynamicConfiguration.java | 44 - .../support/nop/NopDynamicConfiguration.java | 4 +- .../mock/MockDynamicConfiguration.java | 4 +- .../support/apollo/ApolloDynamicConfiguration.java | 10 +--- .../consul/ConsulDynamicConfiguration.java | 38 +++ .../support/etcd/EtcdDynamicConfiguration.java | 27 +-- .../support/etcd/EtcdDynamicConfigurationTest.java | 5 +- .../support/nacos/NacosDynamicConfiguration.java | 56 +- .../nacos/NacosDynamicConfigurationTest.java | 26 +- .../support/zookeeper/CacheListener.java | 13 +++-- .../zookeeper/ZookeeperDynamicConfiguration.java | 49 +++ .../ZookeeperDynamicConfigurationTest.java | 29 ++- .../integration/AbstractConfiguratorListener.java | 3 +- .../registry/integration/RegistryDirectory.java| 12 ++--- .../registry/integration/RegistryProtocol.java | 38 +++ .../apache/dubbo/registry/nacos/NacosRegistry.java | 18 +-- 23 files changed, 204 insertions(+), 254 deletions(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableRouter.java index 564f371..0fe66b0 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableRouter.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableRouter.java @@ -119,7 +119,7 @@ public abstract class ListenableRouter extends AbstractRouter implements Configu } String routerKey = ruleKey + RULE_SUFFIX; configuration.addListener(routerKey, this); -String rule = configuration.getConfig(routerKey); +String rule = configuration.getRule(routerKey, DynamicConfiguration.DEFAULT_GROUP); if (StringUtils.isNotEmpty(rule)) { this.process(new ConfigChangeEvent(routerKey, rule)); } diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ServiceRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ServiceRouter.java index ed3748e..071a07e 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ServiceRouter.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ServiceRouter.java @@ -30,7 +30,7 @@ public class ServiceRouter extends ListenableRouter { private static final int SERVICE_ROUTER_DEFAULT_PRIORITY = 140; public ServiceRouter(DynamicConfiguration configuration, URL url) { -super(configuration, url, url.getEncodedServiceKey()); +super(configuration, url, DynamicConfiguration.getRuleKey(url)); this.priority = SERVICE_ROUTER_DEFAULT_PRIORITY; } } diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java index c6387fe..c96f6a2 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagRouter.java @@ -40,8 +40,8 @@ import java.util.List; import java.util.function.Predicate; import java.util.stream.Collectors; -import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY; import static org.apache.dubbo.rpc.Constants.FORCE_USE_TAG; +import static org.apache.dubbo.rpc.cluster.Constants.TAG_KEY; /** * TagRouter, "application.tag-router" @@ -249,7 +249,7 @@ public class TagRouter extends AbstractRouter implements ConfigurationListener { String key = providerApplication + RULE_SUFFIX; configuration.addLi
[dubbo] branch master updated: Refactor MetricsFilterTest to use Mockito (#4398)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 4c4b931 Refactor MetricsFilterTest to use Mockito (#4398) 4c4b931 is described below commit 4c4b931ebfbfae7aa551342cf0f48c270dfebadd Author: Daniela Marques de Morais AuthorDate: Wed Jul 3 11:57:06 2019 -0300 Refactor MetricsFilterTest to use Mockito (#4398) * Create constants for 'hash.names' and 'hash.arguments' (#3744) * Fix conflicts of cherry-pick * Add builder class for unit test * Fix builder class * Add apache license --- .../dubbo/monitor/dubbo/AppResponseBuilder.java| 55 +++ .../dubbo/monitor/dubbo/MetricsFilterTest.java | 80 ++ 2 files changed, 105 insertions(+), 30 deletions(-) diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java new file mode 100644 index 000..737572a --- /dev/null +++ b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/AppResponseBuilder.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.monitor.dubbo; + +import org.apache.dubbo.rpc.AppResponse; + +import java.util.Map; + +public class AppResponseBuilder { +private Object result; +private Throwable exception; +private Map attachments; +private AppResponse appResponse; + +private AppResponseBuilder() { +this.appResponse = new AppResponse(); +} + +public static AppResponseBuilder create() { +return new AppResponseBuilder(); +} + +public AppResponse build() { +return new AppResponse(this); +} + +public AppResponseBuilder withResult(Object result) { +this.result = result; +return this; +} + +public AppResponseBuilder withException(Throwable exception) { +this.exception = exception; +return this; +} + +public AppResponseBuilder withAttachments(Map attachments) { +this.attachments = attachments; +return this; +} +} diff --git a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java index 47b607d..c31bd4a 100644 --- a/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java +++ b/dubbo-monitor/dubbo-monitor-default/src/test/java/org/apache/dubbo/monitor/dubbo/MetricsFilterTest.java @@ -20,6 +20,7 @@ import org.apache.dubbo.common.URL; import org.apache.dubbo.common.utils.NetUtils; import org.apache.dubbo.monitor.MetricsService; import org.apache.dubbo.monitor.dubbo.service.DemoService; +import org.apache.dubbo.rpc.AppResponse; import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; import org.apache.dubbo.rpc.Protocol; @@ -37,8 +38,11 @@ import com.alibaba.metrics.MetricName; import com.alibaba.metrics.common.MetricObject; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; + import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import java.util.HashMap; import java.util.List; @@ -57,31 +61,32 @@ import static org.apache.dubbo.monitor.Constants.DUBBO_PROVIDER_METHOD; import static org.apache.dubbo.monitor.Constants.METHOD; import static org.apache.dubbo.monitor.Constants.SERVICE; +import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.mock; + public class MetricsFilterTest { -private final Invoker serviceInvoker = new Invoker() { -@Override -public Class getInterface() { -return DemoService.class; -} +private Invoker serviceInvoker; -public URL getUrl() { -
[dubbo] branch master updated: Add unit tests for org.apache.dubbo.rpc.support.MockInvoker (#4413)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 9b14464 Add unit tests for org.apache.dubbo.rpc.support.MockInvoker (#4413) 9b14464 is described below commit 9b14464c1717549a31f94ca2a532167c1b9f9372 Author: Braavos <35978114+braavo...@users.noreply.github.com> AuthorDate: Tue Jul 2 10:42:07 2019 +0100 Add unit tests for org.apache.dubbo.rpc.support.MockInvoker (#4413) These tests were written using Diffblue Cover. --- .../apache/dubbo/rpc/support/MockInvokerTest.java | 139 + 1 file changed, 139 insertions(+) diff --git a/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MockInvokerTest.java b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MockInvokerTest.java new file mode 100644 index 000..f3e3f17 --- /dev/null +++ b/dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/MockInvokerTest.java @@ -0,0 +1,139 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.dubbo.rpc.support; + +import java.io.Serializable; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; + +import org.apache.dubbo.common.URL; +import org.apache.dubbo.rpc.RpcException; +import org.apache.dubbo.rpc.RpcInvocation; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.apache.dubbo.rpc.Constants.MOCK_KEY; + +public class MockInvokerTest { + +@Test +public void testParseMockValue() throws Exception { +Assertions.assertNull(MockInvoker.parseMockValue("null")); +Assertions.assertNull(MockInvoker.parseMockValue("empty")); + +Assertions.assertTrue((Boolean) MockInvoker.parseMockValue("true")); +Assertions.assertFalse((Boolean) MockInvoker.parseMockValue("false")); + +Assertions.assertEquals(123, MockInvoker.parseMockValue("123")); +Assertions.assertEquals("foo", MockInvoker.parseMockValue("foo")); +Assertions.assertEquals("foo", MockInvoker.parseMockValue("\"foo\"")); +Assertions.assertEquals("foo", MockInvoker.parseMockValue("\'foo\'")); + +Assertions.assertEquals( +new HashMap<>(), MockInvoker.parseMockValue("{}")); +Assertions.assertEquals( +new ArrayList<>(), MockInvoker.parseMockValue("[]")); +Assertions.assertEquals("foo", +MockInvoker.parseMockValue("foo", new Type[]{String.class})); +} + +@Test +public void testInvoke() { +URL url = URL.valueOf("remote://1.2.3.4/" + String.class.getName()); +url = url.addParameter(MOCK_KEY, "return "); +MockInvoker mockInvoker = new MockInvoker(url, String.class); + +RpcInvocation invocation = new RpcInvocation(); +invocation.setMethodName("getSomething"); +Assertions.assertEquals(new HashMap<>(), +mockInvoker.invoke(invocation).getAttachments()); +} + +@Test +public void testInvokeThrowsRpcException1() { +URL url = URL.valueOf("remote://1.2.3.4/" + String.class.getName()); +MockInvoker mockInvoker = new MockInvoker(url, null); + +Assertions.assertThrows(RpcException.class, +() -> mockInvoker.invoke(new RpcInvocation())); +} + +@Test +public void testInvokeThrowsRpcException2() { +URL url = URL.valueOf("remote://1.2.3.4/" + String.class.getName()); +url = url.addParameter(MOCK_KEY, "fail"); +MockInvoker mockInvoker = new MockInvoker(url, String.class); + +RpcInvocation invocation = new RpcInvocation(); +invocation.setMethodName("getSomething"); +Assertions.assertThrows(RpcException.class, +() -> mockInvoker.invoke(inv
[dubbo] branch 2.7.3-release updated: Fix MulticastSocket setInterface choose an unreachable address (#4426)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch 2.7.3-release in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/2.7.3-release by this push: new 3d01797 Fix MulticastSocket setInterface choose an unreachable address (#4426) 3d01797 is described below commit 3d01797afd5616cea1b13e88544c5f9312ba3c70 Author: Shoukai Huang AuthorDate: Tue Jul 2 17:39:11 2019 +0800 Fix MulticastSocket setInterface choose an unreachable address (#4426) --- .../org/apache/dubbo/common/utils/NetUtils.java| 24 -- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java index 6fd1a4e..bef5183 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java @@ -371,13 +371,25 @@ public class NetUtils { while (addresses.hasMoreElements()) { InetAddress address = (InetAddress) addresses.nextElement(); if (preferIpv6 && address instanceof Inet6Address) { -multicastSocket.setInterface(address); -interfaceSet = true; -break; +try { +if(address.isReachable(100)){ +multicastSocket.setInterface(address); +interfaceSet = true; +break; +} +} catch (IOException e) { +// ignore +} } else if (!preferIpv6 && address instanceof Inet4Address) { -multicastSocket.setInterface(address); -interfaceSet = true; -break; +try { +if(address.isReachable(100)){ +multicastSocket.setInterface(address); +interfaceSet = true; +break; +} +} catch (IOException e) { +// ignore +} } } if (interfaceSet) {
[dubbo] branch master updated: use StringUtils (#4438)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 1956f2d use StringUtils (#4438) 1956f2d is described below commit 1956f2d621a1b103f606cca36ccb6ac7d631d051 Author: zhenxianyimeng <1920405...@qq.com> AuthorDate: Tue Jul 2 14:20:13 2019 +0800 use StringUtils (#4438) --- .../apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java index 3ad8243..af42c9a 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/schema/DubboBeanDefinitionParser.java @@ -94,7 +94,7 @@ public class DubboBeanDefinitionParser implements BeanDefinitionParser { id = generatedBeanName + (counter++); } } -if (id != null && id.length() > 0) { +if (StringUtils.isNotEmpty(id)) { if (parserContext.getRegistry().containsBeanDefinition(id)) { throw new IllegalStateException("Duplicate spring bean id " + id); }
[dubbo] branch master updated (52bef81 -> 024651d)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from 52bef81 synchronized local variables or parameters should be set to final (#4325) add 024651d fix bug about nacos (#4308) No new revisions were added by this update. Summary of changes: .../java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
[dubbo] branch master updated: synchronized local variables or parameters should be set to final (#4325)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 52bef81 synchronized local variables or parameters should be set to final (#4325) 52bef81 is described below commit 52bef8117b3b44dcb25df6f95914f94776a0cc73 Author: jimin AuthorDate: Thu Jun 27 15:01:45 2019 +0800 synchronized local variables or parameters should be set to final (#4325) * synchronized local variables or parameters should be set to final Signed-off-by: slievrly * remove unused import Signed-off-by: slievrly --- .../src/main/java/org/apache/dubbo/common/bytecode/Proxy.java | 2 +- .../main/java/org/apache/dubbo/common/extension/ExtensionLoader.java | 2 +- .../java/org/apache/dubbo/registry/multicast/MulticastRegistry.java | 4 ++-- .../src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Proxy.java b/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Proxy.java index 2da2818..808a859 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Proxy.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/bytecode/Proxy.java @@ -102,7 +102,7 @@ public abstract class Proxy { String key = sb.toString(); // get cache by class loader. -Map cache; +final Map cache; synchronized (PROXY_CACHE_MAP) { cache = PROXY_CACHE_MAP.computeIfAbsent(cl, k -> new HashMap<>()); } diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java index 18b216d..4b5a44f 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/ExtensionLoader.java @@ -342,7 +342,7 @@ public class ExtensionLoader { if ("true".equals(name)) { return getDefaultExtension(); } -Holder holder = getOrCreateHolder(name); +final Holder holder = getOrCreateHolder(name); Object instance = holder.get(); if (instance == null) { synchronized (holder) { diff --git a/dubbo-registry/dubbo-registry-multicast/src/main/java/org/apache/dubbo/registry/multicast/MulticastRegistry.java b/dubbo-registry/dubbo-registry-multicast/src/main/java/org/apache/dubbo/registry/multicast/MulticastRegistry.java index 27aded1..0c28445 100644 --- a/dubbo-registry/dubbo-registry-multicast/src/main/java/org/apache/dubbo/registry/multicast/MulticastRegistry.java +++ b/dubbo-registry/dubbo-registry-multicast/src/main/java/org/apache/dubbo/registry/multicast/MulticastRegistry.java @@ -263,7 +263,7 @@ public class MulticastRegistry extends FailbackRegistry { } @Override -public void doSubscribe(URL url, NotifyListener listener) { +public void doSubscribe(URL url, final NotifyListener listener) { if (ANY_VALUE.equals(url.getServiceInterface())) { admin = true; } @@ -324,7 +324,7 @@ public class MulticastRegistry extends FailbackRegistry { } urls.add(url); List list = toList(urls); -for (NotifyListener listener : entry.getValue()) { +for (final NotifyListener listener : entry.getValue()) { notify(key, listener, list); synchronized (listener) { listener.notify(); diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java index 19090c1..a248fa4 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/ActiveLimitFilter.java @@ -57,7 +57,7 @@ public class ActiveLimitFilter extends ListenableFilter { URL url = invoker.getUrl(); String methodName = invocation.getMethodName(); int max = invoker.getUrl().getMethodParameter(methodName, ACTIVES_KEY, 0); -RpcStatus rpcStatus = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName()); +final RpcStatus rpcStatus = RpcStatus.getStatus(invoker.getUrl(), invocation.getMethodName()); if (!RpcStatus.beginCount(url, methodName, max)) { long timeout = invoker.getUrl().getMethodParameter(invocation.getMethodName(), TIMEOUT_KEY, 0); long start = System.currentTimeMillis(); @@ -109,7 +109,7 @@ public class ActiveLimitFilter extends ListenableFilter {
[dubbo] branch master updated: add zookeeper maven dependency so that on change registery can run the demo (#4352)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 60c9d9d add zookeeper maven dependency so that on change registery can run the demo (#4352) 60c9d9d is described below commit 60c9d9dbbc8db2dccc019df82d7a9194d4ccbdfa Author: zhenxianyimeng <1920405...@qq.com> AuthorDate: Thu Jun 20 07:02:59 2019 +0800 add zookeeper maven dependency so that on change registery can run the demo (#4352) --- .../dubbo-demo-annotation/dubbo-demo-annotation-consumer/pom.xml | 8 .../dubbo-demo-annotation/dubbo-demo-annotation-provider/pom.xml | 8 dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml | 8 dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml | 8 4 files changed, 32 insertions(+) diff --git a/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-consumer/pom.xml b/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-consumer/pom.xml index c13bc26..c8f9d9d 100644 --- a/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-consumer/pom.xml +++ b/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-consumer/pom.xml @@ -44,6 +44,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-rpc-dubbo diff --git a/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-provider/pom.xml b/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-provider/pom.xml index 4f164bc..02d0248 100644 --- a/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-provider/pom.xml +++ b/dubbo-demo/dubbo-demo-annotation/dubbo-demo-annotation-provider/pom.xml @@ -45,6 +45,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-rpc-dubbo diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml index 4dfde79..5720551 100644 --- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml +++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml @@ -40,6 +40,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-config-spring diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml index a93c41c..c683235 100644 --- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml +++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml @@ -42,6 +42,14 @@ org.apache.dubbo +dubbo-registry-zookeeper + + +org.apache.dubbo +dubbo-configcenter-zookeeper + + +org.apache.dubbo dubbo-rpc-dubbo
[dubbo] branch master updated (041a6ad -> 81e61cc)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from 041a6ad [Dubbo-4323]fix use AtomicInteger instead of volatile to inc (#4324) add 81e61cc remove unnecessary null check before instance of (#4321) No new revisions were added by this update. Summary of changes: .../apache/dubbo/common/beanutil/JavaBeanSerializeUtil.java| 4 ++-- .../src/main/java/org/apache/dubbo/common/json/JSONArray.java | 10 +- .../src/main/java/org/apache/dubbo/common/json/JSONObject.java | 10 +- .../apache/dubbo/registry/support/ProviderInvokerWrapper.java | 2 +- .../org/apache/dubbo/remoting/transport/netty/NettyHelper.java | 2 +- .../dubbo/rpc/protocol/dubbo/decode/DubboTelnetDecodeTest.java | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-)
[dubbo-erlang] branch master updated: style: add issue template
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-erlang.git The following commit(s) were added to refs/heads/master by this push: new 57f5e27 style: add issue template new 71eeca7 Merge pull request #10 from DLive/issue-template 57f5e27 is described below commit 57f5e2736610c94b9cc176a75942f8d9daef354a Author: DLive AuthorDate: Mon Jun 17 23:46:51 2019 +0800 style: add issue template --- .github/ISSUE_TEMPLATE/issue-report-template.md| 35 ++ .../PULL_REQUEST_TEMPLATE/pull_request_template.md | 20 + 2 files changed, 55 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/issue-report-template.md b/.github/ISSUE_TEMPLATE/issue-report-template.md new file mode 100644 index 000..9663a60 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-report-template.md @@ -0,0 +1,35 @@ +--- +name: Dubbo-erlang issue report template +about: If you would like to report a issue to dubbo-erlang, please use this template. + +--- + +- [ ] I have searched the [issues](https://github.com/apache/dubbo-erlang/issues) of this repository and believe that this is not a duplicate. + +### Environment + +* Dubbo-erlang version: xxx +* Operating System version: xxx +* Erlang version: xxx + +### Steps to reproduce this issue + +1. xxx +2. xxx +3. xxx + +Pls. provide [GitHub address] to reproduce this issue. + +### Expected Result + +What do you expected from the above steps? + +### Actual Result + +What actually happens? + +If there is an exception, please attach the exception trace: + +``` +Just put your stack trace here! +``` \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 000..14d5813 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,20 @@ +## What is the purpose of the change + +X + +## Brief changelog + +X + +## Verifying this change + +X + +Follow this checklist to help us incorporate your contribution quickly and easily: + +- [x] Make sure there is a [GITHUB_issue](https://github.com/apache/dubbo-erlang/issues) field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue. +- [ ] Format the pull request title like `[Dubbo-XXX] Fix UnknownException when host config not exist #XXX`. Each commit in the pull request should have a meaningful subject line and body. +- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. +- [ ] Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in [samples](https://github.com/apache/dubbo-erlang/samples). +- [ ] Run `rebar3 eunit` & `rebar3 ct --sys_config config_example/sys.config` to make sure unit-test and integration-test pass. +- [ ] If this contribution is large, please follow the [Software Donation Guide](https://github.com/apache/dubbo/wiki/Software-donation-guide). \ No newline at end of file
[dubbo-go] branch master updated: Fix: close client before close sessions to defeat client stop too slowly when got a signal
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new 36ff235 Fix: close client before close sessions to defeat client stop too slowly when got a signal new 23f39b2 Merge pull request #97 from divebomb/master 36ff235 is described below commit 36ff2350955a9f394bb393b28b20836b3e494114 Author: AlexStocks AuthorDate: Sun Jun 16 22:05:43 2019 +0800 Fix: close client before close sessions to defeat client stop too slowly when got a signal --- protocol/dubbo/pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/dubbo/pool.go b/protocol/dubbo/pool.go index 0ab43ed..c3b106e 100644 --- a/protocol/dubbo/pool.go +++ b/protocol/dubbo/pool.go @@ -225,13 +225,13 @@ func (c *gettyRPCClient) close() error { c.once.Do(func() { // delete @c from client pool c.pool.remove(c) + c.gettyClient.Close() + c.gettyClient = nil for _, s := range c.sessions { logger.Infof("close client session{%s, last active:%s, request number:%d}", s.session.Stat(), s.session.GetActive().String(), s.reqNum) s.session.Close() } - c.gettyClient.Close() - c.gettyClient = nil c.sessions = c.sessions[:0] c.created = 0
[dubbo-go] branch master updated: Fix: alexstocks/getty issue 18
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new ea6c157 Fix: alexstocks/getty issue 18 new c8554c3 Merge pull request #96 from divebomb/master ea6c157 is described below commit ea6c15753d59672a79f5b10988cb007a5c35b83d Author: AlexStocks AuthorDate: Fri Jun 14 22:20:07 2019 +0800 Fix: alexstocks/getty issue 18 --- protocol/dubbo/readwriter.go | 11 +-- protocol/dubbo/server.go | 8 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/protocol/dubbo/readwriter.go b/protocol/dubbo/readwriter.go index 6d789ae..529aa75 100644 --- a/protocol/dubbo/readwriter.go +++ b/protocol/dubbo/readwriter.go @@ -24,7 +24,7 @@ import ( import ( "github.com/dubbogo/getty" - "github.com/dubbogo/hessian2" + hessian "github.com/dubbogo/hessian2" perrors "github.com/pkg/errors" ) import ( @@ -89,12 +89,11 @@ func (p *RpcClientPackageHandler) Write(ss getty.Session, pkg interface{}) error // RpcServerPackageHandler -type RpcServerPackageHandler struct { -} +var ( + rpcServerPkgHandler = {} +) -func NewRpcServerPackageHandler() *RpcServerPackageHandler { - return {} -} +type RpcServerPackageHandler struct{} func (p *RpcServerPackageHandler) Read(ss getty.Session, data []byte) (interface{}, int, error) { pkg := { diff --git a/protocol/dubbo/server.go b/protocol/dubbo/server.go index 80568c6..8bed30f 100644 --- a/protocol/dubbo/server.go +++ b/protocol/dubbo/server.go @@ -79,6 +79,8 @@ type Server struct { conf ServerConfig tcpServer getty.Server exporter protocol.Exporter + + rpcHandler *RpcServerHandler } func NewServer(exporter protocol.Exporter) *Server { @@ -88,6 +90,8 @@ func NewServer(exporter protocol.Exporter) *Server { conf: *srvConf, } + s.rpcHandler = NewRpcServerHandler(s.exporter, s.conf.SessionNumber, s.conf.sessionTimeout) + return s } @@ -116,8 +120,8 @@ func (s *Server) newSession(session getty.Session) error { session.SetName(conf.GettySessionParam.SessionName) session.SetMaxMsgLen(conf.GettySessionParam.MaxMsgLen) - session.SetPkgHandler(NewRpcServerPackageHandler()) - session.SetEventListener(NewRpcServerHandler(s.exporter, conf.SessionNumber, conf.sessionTimeout)) + session.SetPkgHandler(rpcServerPkgHandler) + session.SetEventListener(s.rpcHandler) session.SetRQLen(conf.GettySessionParam.PkgRQSize) session.SetWQLen(conf.GettySessionParam.PkgWQSize) session.SetReadTimeout(conf.GettySessionParam.tcpReadTimeout)
[dubbo-go] branch master updated (47afe5a -> 0032f9c)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from 47afe5a Merge pull request #93 from wongoo/fix-issue71 new 088fd67 Fix: for p2p bug new 3c4b066 Mod:modify some log info new 1038cff Mod:read me new 0032f9c Merge pull request #94 from hxmhlt/master The 374 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: README.md| 2 +- README_CN.md | 2 +- config/service_config.go | 36 3 files changed, 26 insertions(+), 14 deletions(-)
[dubbo-go] branch master updated: fix issue #71
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new 6f9acee fix issue #71 new 47afe5a Merge pull request #93 from wongoo/fix-issue71 6f9acee is described below commit 6f9aceecc6bc105ff01387428349ad261a4b9a53 Author: wongoo AuthorDate: Thu Jun 13 19:45:59 2019 +0800 fix issue #71 --- go.mod| 2 +- go.sum| 4 ++-- protocol/dubbo/client_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 4c22764..213d7ee 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apache/dubbo-go require ( github.com/dubbogo/getty v1.0.7 - github.com/dubbogo/hessian2 v1.0.1 + github.com/dubbogo/hessian2 v1.0.2 github.com/pkg/errors v0.8.1 github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec github.com/stretchr/testify v1.3.0 diff --git a/go.sum b/go.sum index a4fd7f5..f39e814 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dubbogo/getty v1.0.7 h1:5Hg+JwXyCKm9Yr4yJkm98ahhnoa8c2h6br5QJxwQ+YU= github.com/dubbogo/getty v1.0.7/go.mod h1:cRMSuoCmwc5lULFFnYZTxyCfZhObmRTNbS7XRnPNHSo= -github.com/dubbogo/hessian2 v1.0.1 h1:ztI7gJxR3Isxrrl2jE1IZKX61eNR93eRKGhn49vPEX8= -github.com/dubbogo/hessian2 v1.0.1/go.mod h1:XFGDn4oSZX26zkcfhkM/fCJrOqwQJxk/xgWW1KMJBKM= +github.com/dubbogo/hessian2 v1.0.2 h1:Ka9Z32ZszGAdCpgrGuZQmwkT0qe1pd3o9r7ERCDnSlQ= +github.com/dubbogo/hessian2 v1.0.2/go.mod h1:XFGDn4oSZX26zkcfhkM/fCJrOqwQJxk/xgWW1KMJBKM= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= diff --git a/protocol/dubbo/client_test.go b/protocol/dubbo/client_test.go index 14982c6..d9ba540 100644 --- a/protocol/dubbo/client_test.go +++ b/protocol/dubbo/client_test.go @@ -91,7 +91,7 @@ func TestClient_Call(t *testing.T) { user = {} err = c.Call("127.0.0.1:2", url, "GetUser1", []interface{}{"1", "username"}, user) - assert.EqualError(t, err, "got exception: error") + assert.EqualError(t, err, "error") user2 := []interface{}{} err = c.Call("127.0.0.1:2", url, "GetUser2", []interface{}{"1", "username"}, )
[dubbo-js] branch master updated: fix beginning steps
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new 9fcc01c fix beginning steps new 0873a1b Merge pull request #120 from going-merry0/master 9fcc01c is described below commit 9fcc01c0800c3535c129d4a3050ec3f450c70e14 Author: hsiaosiyuan0 AuthorDate: Thu Jun 13 00:46:50 2019 +0800 fix beginning steps --- README.md | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afbf90c..c79545f 100644 --- a/README.md +++ b/README.md @@ -116,13 +116,16 @@ docker-compose up # start java cd java/dubbo-demo mvn clean install -cd dubbo-demo-provider +cd java/dubbo-demo/dubbo-demo-provider mvn clean package java -jar target/dubbo-demo-provider-2.6.3-jar-with-dependencies.jar +# build +make + # start node cd example/hello-koa -DEBUG=dubbo* node server.js +npm run debug:start # test /hello curl http://localhost:3000/hello
[dubbo-go] branch master updated (51406b3 -> f16fce4)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from 51406b3 Merge pull request #89 from dubbo-x/issue88 new ec67719 Ref: refactor code in registry.zookeeper, create remoting/zookeeper to code reuse in config_center for zk new d7b9412 Mod: format the code & add apache license new 7586d67 Mod: resolve conflict new cfc316c Mod: DataListener move to common new 0039ac6 Mod: DataListener move to remoting new a8596b5 Fmt:format code new d8763ab Mod:resolve conflict new d15a274 Mod:format code new f16fce4 Merge pull request #87 from hxmhlt/master The 346 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: common/constant/key.go | 5 + common/extension/{registry.go => config_center.go} | 16 +- .../dynamic_configuration.go | 54 ++-- config_center/zookeeper/dynamic_configuration.go | 134 + registry/directory/directory.go| 5 +- registry/directory/directory_test.go | 9 +- registry/event.go | 23 +- registry/zookeeper/listener.go | 311 +++-- registry/zookeeper/registry.go | 244 ++-- registry/zookeeper/registry_test.go| 12 +- registry/event.go => remoting/listener.go | 53 ++-- .../zk_client.go => remoting/zookeeper/client.go | 213 +- .../zookeeper/client_test.go | 11 +- remoting/zookeeper/container.go| 90 ++ {registry => remoting}/zookeeper/listener.go | 192 - .../contrib/fatjar/zookeeper-3.4.9-fatjar.jar | Bin 16 files changed, 641 insertions(+), 731 deletions(-) copy common/extension/{registry.go => config_center.go} (61%) copy registry/event.go => config_center/dynamic_configuration.go (58%) create mode 100644 config_center/zookeeper/dynamic_configuration.go copy registry/event.go => remoting/listener.go (59%) rename registry/zookeeper/zk_client.go => remoting/zookeeper/client.go (66%) rename registry/zookeeper/zk_client_test.go => remoting/zookeeper/client_test.go (92%) create mode 100644 remoting/zookeeper/container.go copy {registry => remoting}/zookeeper/listener.go (50%) copy {registry => remoting}/zookeeper/zookeeper-4unitest/contrib/fatjar/zookeeper-3.4.9-fatjar.jar (100%)
[dubbo-go] branch master updated (fafa25e -> 51406b3)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from fafa25e Merge pull request #84 from fangyincheng/fix-hessian2 new 4a91a50 fix issue88 new 30fb7e5 fix issue88 based on os info new adb034d new import clause for third-party package new 51406b3 Merge pull request #89 from dubbo-x/issue88 The 337 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: common/logger/logger_test.go | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-)
[dubbo-go] branch master updated (4f7ef9d -> fafa25e)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git. from 4f7ef9d Imp: add Client.GetPendingResponse to limit the lock scope (#83) new 4f779d4 Fix:big pkg and hessian2 new 5e3e439 Mod:big pkg ut new ebb1a02 Fix: readHeader error new 9f0a843 Mod:del a temple var new 2954fad Fix:heartbeat and exception new fafa25e Merge pull request #84 from fangyincheng/fix-hessian2 The 333 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: examples/dubbo/go-client/app/client.go | 2 +- go.mod | 4 +- go.sum | 10 - protocol/dubbo/client.go | 2 +- protocol/dubbo/client_test.go | 29 +--- protocol/dubbo/codec.go| 12 +++-- protocol/dubbo/listener.go | 4 +- protocol/dubbo/readwriter.go | 80 ++ 8 files changed, 87 insertions(+), 56 deletions(-)
[dubbo-js] branch master updated (07f496b -> a10aea8)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-js.git. from 07f496b Merge pull request #114 from creasy2010/master new 15d4b35 1. add more java provider get as close to the real scene as possible 2. fixed setting bug 3. fixed zookeeper Unreasonable code 4.Next target split registry new c17ca26 split registry module and change hello-koa => typescript new a10aea8 Merge pull request #117 from hufeng/master The 317 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../hello-koa/dubbo/{dubbo-es6.js => dubbo-es6.ts} | 11 +- examples/hello-koa/dubbo/{dubbo.js => dubbo.ts}| 15 ++- examples/hello-koa/dubbo/service.js| 52 examples/hello-koa/dubbo/service.ts| 77 examples/hello-koa/es6-http.js | 13 -- examples/hello-koa/es7-http.js | 10 -- examples/hello-koa/package.json| 5 +- examples/hello-koa/{server.js => server2015.ts}| 16 +-- examples/hello-koa/{server.js => server2017.ts}| 14 +-- tsconfig.json => examples/hello-koa/tsconfig.json | 0 .../provider/{Provider.java => Provider1.java} | 4 +- .../META-INF/spring/dubbo-demo-provider.xml| 1 - ...-demo-provider.xml => dubbo-demo-provider1.xml} | 3 +- packages/dubbo/src/__tests__/zookeeper-test.ts | 13 +- packages/dubbo/src/dubbo-agent.ts | 5 +- packages/dubbo/src/dubbo.ts| 32 +++-- packages/dubbo/src/index.ts| 13 +- packages/dubbo/src/registry/index.ts | 4 + packages/dubbo/src/registry/registry.ts| 60 + packages/dubbo/src/{ => registry}/zookeeper.ts | 138 + packages/dubbo/src/scheduler.ts| 25 ++-- packages/dubbo/src/setting/index.ts| 6 +- packages/dubbo/src/types.ts| 42 --- 23 files changed, 291 insertions(+), 268 deletions(-) rename examples/hello-koa/dubbo/{dubbo-es6.js => dubbo-es6.ts} (83%) rename examples/hello-koa/dubbo/{dubbo.js => dubbo.ts} (82%) delete mode 100644 examples/hello-koa/dubbo/service.js create mode 100644 examples/hello-koa/dubbo/service.ts delete mode 100644 examples/hello-koa/es6-http.js delete mode 100644 examples/hello-koa/es7-http.js copy examples/hello-koa/{server.js => server2015.ts} (81%) rename examples/hello-koa/{server.js => server2017.ts} (82%) copy tsconfig.json => examples/hello-koa/tsconfig.json (100%) copy java/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/{Provider.java => Provider1.java} (91%) copy java/dubbo-demo/dubbo-demo-provider/src/main/resources/META-INF/spring/{dubbo-demo-provider.xml => dubbo-demo-provider1.xml} (93%) create mode 100644 packages/dubbo/src/registry/index.ts create mode 100644 packages/dubbo/src/registry/registry.ts rename packages/dubbo/src/{ => registry}/zookeeper.ts (75%)
[dubbo-go] branch master updated: Fix:issue #68
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-go.git The following commit(s) were added to refs/heads/master by this push: new 9f1a565 Fix:issue #68 new e6882ec Merge pull request #82 from fangyincheng/fix-exception 9f1a565 is described below commit 9f1a565d521b312b392485770b0155e5bb3863e0 Author: fangyincheng AuthorDate: Thu Jun 6 19:29:12 2019 +0800 Fix:issue #68 --- examples/dubbo/go-client/app/user.go | 5 - examples/dubbo/go-server/app/server.go | 2 +- examples/dubbo/go-server/app/user.go | 2 +- .../java-client/src/main/java/com/ikurento/user/Consumer.java | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- protocol/dubbo/codec.go| 2 +- protocol/dubbo/listener.go | 10 +++--- registry/zookeeper/registry.go | 2 +- registry/zookeeper/zk_client.go| 5 - 10 files changed, 24 insertions(+), 14 deletions(-) diff --git a/examples/dubbo/go-client/app/user.go b/examples/dubbo/go-client/app/user.go index ee56e23..59e1051 100644 --- a/examples/dubbo/go-client/app/user.go +++ b/examples/dubbo/go-client/app/user.go @@ -25,10 +25,13 @@ import ( ) import ( - "github.com/apache/dubbo-go/config" hessian "github.com/dubbogo/hessian2" ) +import ( + "github.com/apache/dubbo-go/config" +) + type Gender hessian.JavaEnum func init() { diff --git a/examples/dubbo/go-server/app/server.go b/examples/dubbo/go-server/app/server.go index db0196f..a5c89be 100644 --- a/examples/dubbo/go-server/app/server.go +++ b/examples/dubbo/go-server/app/server.go @@ -26,11 +26,11 @@ import ( ) import ( - "github.com/apache/dubbo-go/common/logger" hessian "github.com/dubbogo/hessian2" ) import ( + "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" _ "github.com/apache/dubbo-go/protocol/dubbo" _ "github.com/apache/dubbo-go/registry/protocol" diff --git a/examples/dubbo/go-server/app/user.go b/examples/dubbo/go-server/app/user.go index c55b040..e4400cc 100644 --- a/examples/dubbo/go-server/app/user.go +++ b/examples/dubbo/go-server/app/user.go @@ -146,7 +146,7 @@ func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User } func (u *UserProvider) GetErr(ctx context.Context, req []interface{}, rsp *User) error { - return perrors.New("exception") + return hessian.NewThrowable("exception") } func (u *UserProvider) GetUser0(id string, name string) (User, error) { diff --git a/examples/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java b/examples/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java index 0e4a926..f1100e7 100644 --- a/examples/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java +++ b/examples/dubbo/java-client/src/main/java/com/ikurento/user/Consumer.java @@ -59,9 +59,9 @@ public class Consumer { } try { userProvider.GetErr("A003"); -} catch (Exception e) { +} catch (Throwable t) { System.out.println("*exception***"); -e.printStackTrace(); +t.printStackTrace(); } } diff --git a/go.mod b/go.mod index 66757f2..df9ce48 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apache/dubbo-go require ( github.com/dubbogo/getty v0.0.0-20190523180329-bdf5e640ea53 - github.com/dubbogo/hessian2 v0.0.0-20190604191323-5290af08fb56 + github.com/dubbogo/hessian2 v0.0.0-20190606185624-13bbc9786e3f github.com/pkg/errors v0.8.1 github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec github.com/stretchr/testify v1.3.0 diff --git a/go.sum b/go.sum index db094a9..f3cd528 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dubbogo/getty v0.0.0-20190523180329-bdf5e640ea53 h1:bniSNoC4xnAbrx4estwc9F0qkWnh6ZDsAS0y9d7mPos= github.com/dubbogo/getty v0.0.0-20190523180329-bdf5e640ea53/go.mod h1:cRMSuoCmwc5lULFFnYZTxyCfZhObmRTNbS7XRnPNHSo= -github.com/dubbogo/hessian2 v0.0.0-20190604191323-5290af08fb56 h1:5ZhIvx1pqtpRSfUzcc6jkF9pFsx/DcwymDuuaM3jFuw= -github.com/dubbogo/hessian2 v0.0.0-20190604191323-5290af08fb56/go.mod h1:XFGDn4oSZX26zkcfhkM/fCJrOqwQJxk/xgWW1KMJBKM= +github.com/dubbogo/hessian2 v0.0
[dubbo] branch master updated (0b27565 -> d3a5166)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from 0b27565 [Dubbo-4218] Fix NPE when the TagRouterRule addresses config is null (#4218) (#4236) add d3a5166 Delete useless code (#4242) No new revisions were added by this update. Summary of changes: .../java/org/apache/dubbo/common/config/AbstractPrefixConfiguration.java | 1 - 1 file changed, 1 deletion(-)
[dubbo] branch 3.x-dev updated: Disclaimer file removal (#4234)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch 3.x-dev in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/3.x-dev by this push: new fc1378f Disclaimer file removal (#4234) fc1378f is described below commit fc1378f604cd95b8a4b455912d0f154faa90b8f2 Author: Peter Pan AuthorDate: Mon Jun 3 03:22:19 2019 +0200 Disclaimer file removal (#4234) --- DISCLAIMER | 1 - 1 file changed, 1 deletion(-) diff --git a/DISCLAIMER b/DISCLAIMER deleted file mode 100644 index bed312a..000 --- a/DISCLAIMER +++ /dev/null @@ -1 +0,0 @@ -Apache Dubbo is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet [...] \ No newline at end of file
[dubbo] branch 2.6.x updated: Disclaimer removed (#4233)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch 2.6.x in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/2.6.x by this push: new 6804236 Disclaimer removed (#4233) 6804236 is described below commit 68042366c2913d123f68f98a189e0f05342a6520 Author: Peter Pan AuthorDate: Mon Jun 3 03:21:15 2019 +0200 Disclaimer removed (#4233) --- DISCLAIMER | 1 - 1 file changed, 1 deletion(-) diff --git a/DISCLAIMER b/DISCLAIMER deleted file mode 100644 index bed312a..000 --- a/DISCLAIMER +++ /dev/null @@ -1 +0,0 @@ -Apache Dubbo is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet [...] \ No newline at end of file
[dubbo] branch master updated: Standardized code (#4211)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 7f7a289 Standardized code (#4211) 7f7a289 is described below commit 7f7a28987853aa511ba18ab3647c34187e88230f Author: Kyle AuthorDate: Fri May 31 12:57:50 2019 +0800 Standardized code (#4211) --- .../java/org/apache/dubbo/xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java| 1 + 1 file changed, 1 insertion(+) diff --git a/dubbo-rpc/dubbo-rpc-xml/src/main/java/org/apache/dubbo/xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java b/dubbo-rpc/dubbo-rpc-xml/src/main/java/org/apache/dubbo/xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java index 1a8240e..acda3de 100644 --- a/dubbo-rpc/dubbo-rpc-xml/src/main/java/org/apache/dubbo/xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java +++ b/dubbo-rpc/dubbo-rpc-xml/src/main/java/org/apache/dubbo/xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java @@ -151,6 +151,7 @@ public class XmlRpcProtocol extends AbstractProxyProtocol { @Override @SuppressWarnings("unchecked") +@Override protected T doRefer(final Class serviceType, URL url) throws RpcException { XmlRpcProxyFactoryBean xmlRpcProxyFactoryBean = new XmlRpcProxyFactoryBean(); xmlRpcProxyFactoryBean.setServiceUrl(url.setProtocol("http").toIdentityString());
[dubbo] branch master updated (4b97a0b -> 177f71b)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git. from 4b97a0b fix for #4175: ServiceConfigurationListener should override ProviderConfigurationListener (#4179) add 177f71b optimize code style (#4188) No new revisions were added by this update. Summary of changes: .../org/apache/dubbo/common/utils/ClassUtils.java | 26 +++--- .../dubbo/registry/support/AbstractRegistry.java | 2 ++ .../registry/support/AbstractRegistryFactory.java | 1 + .../dubbo/registry/support/FailbackRegistry.java | 6 + .../org/apache/dubbo/config/ServiceConfig.java | 12 +- .../java/org/apache/dubbo/rpc/AppResponse.java | 5 + .../java/org/apache/dubbo/rpc/AsyncRpcResult.java | 1 + .../java/org/apache/dubbo/rpc/RpcInvocation.java | 2 ++ .../org/apache/dubbo/rpc/support/MockInvoker.java | 20 - .../rpc/protocol/rmi/RmiRemoteInvocation.java | 6 ++--- .../xml/rpc/protocol/xmlrpc/XmlRpcProtocol.java| 17 ++ .../protocol/xmlrpc/XmlRpcProxyFactoryBean.java| 5 + 12 files changed, 67 insertions(+), 36 deletions(-)
[dubbo-website] branch asf-site updated: update stub-mock (#385)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/dubbo-website.git The following commit(s) were added to refs/heads/asf-site by this push: new e03ad80 update stub-mock (#385) e03ad80 is described below commit e03ad801d7ccd3df3e3918ea518390f013ca667f Author: huaifeng AuthorDate: Fri May 31 07:26:16 2019 +0800 update stub-mock (#385) --- blog/zh-cn/dubbo-stub-mock.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/zh-cn/dubbo-stub-mock.md b/blog/zh-cn/dubbo-stub-mock.md index e3a01c8..7e992b7 100644 --- a/blog/zh-cn/dubbo-stub-mock.md +++ b/blog/zh-cn/dubbo-stub-mock.md @@ -195,7 +195,7 @@ public class DemoServiceMock implements DemoService { ```xml - + ```
[dubbo-website] branch asf-site updated: Add dubbo-erlang user doc (#382)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/dubbo-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 72c4883 Add dubbo-erlang user doc (#382) 72c4883 is described below commit 72c4883a59dc404a8676a8efc50353c10f413e2d Author: DLive AuthorDate: Fri May 31 07:22:05 2019 +0800 Add dubbo-erlang user doc (#382) --- docs/en-us/user/languages/erlang/reference.md | 15 ++ docs/en-us/user/languages/erlang/serialization.md | 17 +++ docs/en-us/user/languages/erlang/service.md | 22 docs/en-us/user/languages/erlang/start.md | 62 +++ docs/zh-cn/user/languages/erlang/reference.md | 15 ++ docs/zh-cn/user/languages/erlang/serialization.md | 21 docs/zh-cn/user/languages/erlang/service.md | 22 docs/zh-cn/user/languages/erlang/start.md | 60 ++ site_config/docs.js | 42 +++ 9 files changed, 276 insertions(+) diff --git a/docs/en-us/user/languages/erlang/reference.md b/docs/en-us/user/languages/erlang/reference.md new file mode 100644 index 000..bb3bfcb --- /dev/null +++ b/docs/en-us/user/languages/erlang/reference.md @@ -0,0 +1,15 @@ +# Consumer Configurations + +## Base Config +Consumer config is under the dubboerl application with sys.config +```erlang +{dubboerl,[ + %% other config ... + {consumer,[ + {<<"interface fullname">>,[Option]}, + %% eg: + {<<"org.apache.dubbo.erlang.sample.service.facade.UserOperator">>,[]}, + ]} +]} +``` +Option is to be added. diff --git a/docs/en-us/user/languages/erlang/serialization.md b/docs/en-us/user/languages/erlang/serialization.md new file mode 100644 index 000..0603dcf --- /dev/null +++ b/docs/en-us/user/languages/erlang/serialization.md @@ -0,0 +1,17 @@ +# Protocol Configurations + +The library now only supports hessian and json serialization. + +## Configuration example +Protocol config is under the dubboerl application with sys.config +```erlang +{dubboerl,[ + %% other config ... + {protocol,hessian} +]} +``` + +| ConfigName | Type | DefaultValue | Remarks | +| --- | --- | --- | --- | +| protocol | atom() | hessian | hessian,json | + \ No newline at end of file diff --git a/docs/en-us/user/languages/erlang/service.md b/docs/en-us/user/languages/erlang/service.md new file mode 100644 index 000..86418ac --- /dev/null +++ b/docs/en-us/user/languages/erlang/service.md @@ -0,0 +1,22 @@ +# Provider Configurations + +## Base Config +Provider config is under the dubboerl application with sys.config +```erlang +{dubboerl,[ + %% other config ... + {provider,[ + {module_implements,interface_module,interface_fullname,[Options]}, + %% eg: + {userOperator_impl,userOperator,<<"org.apache.dubbo.erlang.sample.service.facade.UserOperator">>,[Option]} + ]} +]} +``` + +| ConfigName | Type | DefaultValue | Remarks | +| --- | --- | --- | --- | +| module_implements | atom() | - | The service implements module name| +| interface_module | atom() | - | Interface module name is transfer form java jar | +| interface_fullname | binary() | - | Interface full name is the java class name | + +Option is to be added. \ No newline at end of file diff --git a/docs/en-us/user/languages/erlang/start.md b/docs/en-us/user/languages/erlang/start.md new file mode 100644 index 000..b2e5d46 --- /dev/null +++ b/docs/en-us/user/languages/erlang/start.md @@ -0,0 +1,62 @@ +# Quick Start + +We recommend using java to define the Dubbo interface. And use [erlanalysis](https://github.com/apache/dubbo-erlang/tree/master/tools/erlanalysis) +tool parse java interface transfer to erlang lib. + +## Import Dependency Lib + + +### Using Rebar Build Tool +Add dubblerl to rebar.config with your project +```erlang +{deps, [ +{dubboerl, {git, "https://github.com/apache/dubbo-erlang.git;, {branch, "master"}}} +]}. +``` + +### User erlang.mk Build Tool +`Waiting for improvement` + +## Import interface lib +Suppose the interface lib you exported is called dubbo_service. +* If you didn't upload your lib to your git repository, It is recommended that you copy the `dubbo_service` lib +into the project's `apps` directory. +* If it is upload to your git repository, you can import like this: +```erlang +{deps, [ +{dubboerl, {git, "https://github.com/apache/dubbo-erlang.git;, {branch, "master"}}}, +{dubbo_service,{git,"${INTERFACE_LIB_URL}",{branch,"master"}}} %% replace ${INTERFACE_LIB_URL} with your lib git repos url +]}. +``` + +## Consumer Configuration +Please reference [Reference Config](./reference.md) + +## Init dubbolib
[dubbo] branch dubbo-4200 deleted (was 23eb7fb)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch dubbo-4200 in repository https://gitbox.apache.org/repos/asf/dubbo.git. was 23eb7fb [Dubbo-4200] Nacos group should be not resolved from key. This change permanently discards the following revisions: discard 23eb7fb [Dubbo-4200] Nacos group should be not resolved from key.
[dubbo] branch ralf0131-patch-1 deleted (was 86e7eaf)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch ralf0131-patch-1 in repository https://gitbox.apache.org/repos/asf/dubbo.git. was 86e7eaf Create security.md The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
[dubbo] branch dubbo-4200 updated (02171c3 -> 23eb7fb)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch dubbo-4200 in repository https://gitbox.apache.org/repos/asf/dubbo.git. discard 02171c3 [Dubbo-4200] Nacos group should be not resolved from key. omit 4b97a0b fix for #4175: ServiceConfigurationListener should override ProviderConfigurationListener (#4179) omit 21cfe11 Create security.md (#4165) omit 61ab320 Delete dead code (#4189) omit 28bea9c [DUBBO-3137]: get rid of ConfigConstants, RpcConstatns, RemotingConstants (#4138) add ae1e3bd sync pull request 4138 (#4181) add 321afae Remove licence from dependency (#4186) add bfc6202 performance tuning: avoid reflection on the critical path (#4190) add d2ba946 2.7.2 release note (#4187) new 23eb7fb [Dubbo-4200] Nacos group should be not resolved from key. This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (02171c3) \ N -- N -- N refs/heads/dubbo-4200 (23eb7fb) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omit" are not gone; other references still refer to them. Any revisions marked "discard" are gone forever. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CHANGES.md | 89 ++ SECURITY.md| 31 .../apache/dubbo/common/config/Configuration.java | 4 + .../com/alibaba/dubbo/rpc/support/RpcUtils.java| 5 -- dubbo-dependencies-bom/pom.xml | 6 ++ .../registry/integration/RegistryProtocol.java | 2 +- .../main/java/org/apache/dubbo/rpc/Constants.java | 4 - .../java/org/apache/dubbo/rpc/RpcInvocation.java | 2 +- .../dubbo/rpc/proxy/AbstractProxyInvoker.java | 6 +- .../org/apache/dubbo/rpc/support/RpcUtils.java | 18 ++--- .../dubbo/rpc/protocol/dubbo/DubboCodec.java | 5 +- 11 files changed, 110 insertions(+), 62 deletions(-) delete mode 100644 SECURITY.md
[dubbo] 01/01: [Dubbo-4200] Nacos group should be not resolved from key.
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch dubbo-4200 in repository https://gitbox.apache.org/repos/asf/dubbo.git commit 23eb7fb50516c62efb6e736cfed55927a22de5f2 Author: Huxing Zhang AuthorDate: Thu May 30 12:44:03 2019 +0800 [Dubbo-4200] Nacos group should be not resolved from key. --- .../support/nacos/NacosDynamicConfiguration.java | 48 -- .../nacos/NacosDynamicConfigurationTest.java | 10 +++-- .../metadata/store/nacos/NacosMetadataReport.java | 12 +- .../store/nacos/NacosMetadataReportTest.java | 8 ++-- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java b/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java index 96bec25..9fdb8eb 100644 --- a/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java +++ b/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java @@ -57,6 +57,10 @@ import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY; public class NacosDynamicConfiguration implements DynamicConfiguration { private final Logger logger = LoggerFactory.getLogger(getClass()); +/** + * the default timeout in millis to get config from nacos + */ +private static final long DEFAULT_TIMEOUT = 5000L; /** * The final root path would be: /$NAME_SPACE/config @@ -93,24 +97,14 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { return configService; } -public void publishNacosConfig(String key, String value) { +public void publishNacosConfig(String key, String group, String value) { try { -String[] keyAndGroup = getKeyAndGroup(key); -configService.publishConfig(keyAndGroup[0], keyAndGroup[1], value); +configService.publishConfig(key, group, value); } catch (NacosException e) { logger.error(e.getErrMsg()); } } -private String[] getKeyAndGroup(String key) { -int i = key.lastIndexOf(GROUP_CHAR_SEPERATOR); -if (i < 0) { -return new String[]{key, null}; -} else { -return new String[]{key.substring(0, i), key.substring(i+1)}; -} -} - private Properties buildNacosProperties(URL url) { Properties properties = new Properties(); setServerAddr(url, properties); @@ -164,32 +158,19 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { @Override public void addListener(String key, String group, ConfigurationListener listener) { -String[] keyAndGroup = getKeyAndGroup(key); -if (keyAndGroup[1] != null) { -group = keyAndGroup[1]; -} -String finalGroup = group; -NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(generateKey(key, group), k -> createTargetListener(key, finalGroup)); String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; +NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(key, k -> createTargetListener(keyInNacos, group)); nacosConfigListener.addListener(listener); try { configService.addListener(keyInNacos, group, nacosConfigListener); -System.out.println("1"); } catch (NacosException e) { logger.error(e.getMessage()); } } -private String generateKey(String key, String group) { -if (StringUtils.isNotEmpty(group)) { -key = key + GROUP_CHAR_SEPERATOR + group; -} -return key; -} - @Override public void removeListener(String key, String group, ConfigurationListener listener) { -NacosConfigListener eventListener = watchListenerMap.get(generateKey(key, group)); +NacosConfigListener eventListener = watchListenerMap.get(key); if (eventListener != null) { eventListener.removeListener(listener); } @@ -197,8 +178,14 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { @Override public String getConfig(String key, String group, long timeout) throws IllegalStateException { -key = generateKey(key, group); -return (String) getInternalProperty(rootPath + PROPERTIES_CHAR_SEPERATOR + key); +try { +String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; +long nacosTimeout = timeout < 0 ? DEFAULT_TIMEOUT : timeout; +return configService.getConfig(keyInNacos, group, nacosTimeout); +} c
[dubbo] 01/01: [Dubbo-4200] Nacos group should be not resolved from key.
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch dubbo-4200 in repository https://gitbox.apache.org/repos/asf/dubbo.git commit 02171c39c40a0e9570c63fb33d0d27b7dab9e84a Author: Huxing Zhang AuthorDate: Thu May 30 12:39:57 2019 +0800 [Dubbo-4200] Nacos group should be not resolved from key. --- .../support/nacos/NacosDynamicConfiguration.java | 48 -- .../nacos/NacosDynamicConfigurationTest.java | 10 +++-- .../metadata/store/nacos/NacosMetadataReport.java | 12 +- .../store/nacos/NacosMetadataReportTest.java | 8 ++-- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java b/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java index 96bec25..9fdb8eb 100644 --- a/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java +++ b/dubbo-configcenter/dubbo-configcenter-nacos/src/main/java/org/apache/dubbo/configcenter/support/nacos/NacosDynamicConfiguration.java @@ -57,6 +57,10 @@ import static org.apache.dubbo.common.constants.RemotingConstants.BACKUP_KEY; public class NacosDynamicConfiguration implements DynamicConfiguration { private final Logger logger = LoggerFactory.getLogger(getClass()); +/** + * the default timeout in millis to get config from nacos + */ +private static final long DEFAULT_TIMEOUT = 5000L; /** * The final root path would be: /$NAME_SPACE/config @@ -93,24 +97,14 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { return configService; } -public void publishNacosConfig(String key, String value) { +public void publishNacosConfig(String key, String group, String value) { try { -String[] keyAndGroup = getKeyAndGroup(key); -configService.publishConfig(keyAndGroup[0], keyAndGroup[1], value); +configService.publishConfig(key, group, value); } catch (NacosException e) { logger.error(e.getErrMsg()); } } -private String[] getKeyAndGroup(String key) { -int i = key.lastIndexOf(GROUP_CHAR_SEPERATOR); -if (i < 0) { -return new String[]{key, null}; -} else { -return new String[]{key.substring(0, i), key.substring(i+1)}; -} -} - private Properties buildNacosProperties(URL url) { Properties properties = new Properties(); setServerAddr(url, properties); @@ -164,32 +158,19 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { @Override public void addListener(String key, String group, ConfigurationListener listener) { -String[] keyAndGroup = getKeyAndGroup(key); -if (keyAndGroup[1] != null) { -group = keyAndGroup[1]; -} -String finalGroup = group; -NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(generateKey(key, group), k -> createTargetListener(key, finalGroup)); String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; +NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(key, k -> createTargetListener(keyInNacos, group)); nacosConfigListener.addListener(listener); try { configService.addListener(keyInNacos, group, nacosConfigListener); -System.out.println("1"); } catch (NacosException e) { logger.error(e.getMessage()); } } -private String generateKey(String key, String group) { -if (StringUtils.isNotEmpty(group)) { -key = key + GROUP_CHAR_SEPERATOR + group; -} -return key; -} - @Override public void removeListener(String key, String group, ConfigurationListener listener) { -NacosConfigListener eventListener = watchListenerMap.get(generateKey(key, group)); +NacosConfigListener eventListener = watchListenerMap.get(key); if (eventListener != null) { eventListener.removeListener(listener); } @@ -197,8 +178,14 @@ public class NacosDynamicConfiguration implements DynamicConfiguration { @Override public String getConfig(String key, String group, long timeout) throws IllegalStateException { -key = generateKey(key, group); -return (String) getInternalProperty(rootPath + PROPERTIES_CHAR_SEPERATOR + key); +try { +String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; +long nacosTimeout = timeout < 0 ? DEFAULT_TIMEOUT : timeout; +return configService.getConfig(keyInNacos, group, nacosTimeout); +} c
[dubbo] branch dubbo-4200 created (now 02171c3)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch dubbo-4200 in repository https://gitbox.apache.org/repos/asf/dubbo.git. at 02171c3 [Dubbo-4200] Nacos group should be not resolved from key. This branch includes the following new commits: new 02171c3 [Dubbo-4200] Nacos group should be not resolved from key. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo] branch master updated: fix for #4175: ServiceConfigurationListener should override ProviderConfigurationListener (#4179)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 4b97a0b fix for #4175: ServiceConfigurationListener should override ProviderConfigurationListener (#4179) 4b97a0b is described below commit 4b97a0ba8b5edcedb37a320e00cd5bc36f304f90 Author: uglycow AuthorDate: Wed May 29 10:27:03 2019 +0800 fix for #4175: ServiceConfigurationListener should override ProviderConfigurationListener (#4179) --- .../java/org/apache/dubbo/registry/integration/RegistryProtocol.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java index 96b060f..b9ad1b3 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java @@ -557,9 +557,9 @@ public class RegistryProtocol implements Protocol { URL currentUrl = exporter.getInvoker().getUrl(); //Merged with this configuration URL newUrl = getConfigedInvokerUrl(configurators, originUrl); +newUrl = getConfigedInvokerUrl(providerConfigurationListener.getConfigurators(), newUrl); newUrl = getConfigedInvokerUrl(serviceConfigurationListeners.get(originUrl.getServiceKey()) .getConfigurators(), newUrl); -newUrl = getConfigedInvokerUrl(providerConfigurationListener.getConfigurators(), newUrl); if (!currentUrl.equals(newUrl)) { RegistryProtocol.this.reExport(originInvoker, newUrl); logger.info("exported provider url changed, origin url: " + originUrl +
[dubbo] branch master updated: Delete dead code (#4189)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/master by this push: new 61ab320 Delete dead code (#4189) 61ab320 is described below commit 61ab3209b230cb2171945cdf8326a49d942cabd7 Author: Taosheng Wei AuthorDate: Wed May 29 10:05:30 2019 +0800 Delete dead code (#4189) --- .../src/main/java/org/apache/dubbo/common/config/Configuration.java | 4 1 file changed, 4 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/config/Configuration.java b/dubbo-common/src/main/java/org/apache/dubbo/common/config/Configuration.java index 7937b9d..6fa15bd 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/config/Configuration.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/config/Configuration.java @@ -105,10 +105,6 @@ public interface Configuration { return cls.cast(value); } -if (String.class.equals(cls)) { -return cls.cast(value); -} - if (Boolean.class.equals(cls) || Boolean.TYPE.equals(cls)) { obj = Boolean.valueOf(value); } else if (Number.class.isAssignableFrom(cls) || cls.isPrimitive()) {
[dubbo] branch 2.7.2-release updated: Remove licence from dependency (#4186)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch 2.7.2-release in repository https://gitbox.apache.org/repos/asf/dubbo.git The following commit(s) were added to refs/heads/2.7.2-release by this push: new 321afae Remove licence from dependency (#4186) 321afae is described below commit 321afae3eab0293b9cd3fb9f82702c0d37045e76 Author: cvictory AuthorDate: Wed May 29 09:42:44 2019 +0800 Remove licence from dependency (#4186) --- dubbo-dependencies-bom/pom.xml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/dubbo-dependencies-bom/pom.xml b/dubbo-dependencies-bom/pom.xml index 3573df1..e6b8c36 100644 --- a/dubbo-dependencies-bom/pom.xml +++ b/dubbo-dependencies-bom/pom.xml @@ -597,6 +597,12 @@ io.etcd jetcd-launcher ${etcd_launcher_version} + + +com.github.spotbugs +spotbugs-annotations + + org.testcontainers
[dubbo] 01/01: Create security.md
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch ralf0131-patch-1 in repository https://gitbox.apache.org/repos/asf/dubbo.git commit 86e7eaf5bee46c6d04dc54b73b5a07fa0ed6d12f Author: Huxing Zhang AuthorDate: Sat May 25 20:00:52 2019 +0800 Create security.md --- SECURITY.md | 31 +++ 1 file changed, 31 insertions(+) diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000..5f67609 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,31 @@ +# Security Policy + +## Supported Versions + +Below is a table that shows versions that accept security fix. + +| Version | Supported | +| --- | -- | +| 2.7.x | :white_check_mark: | +| 2.6.x | :white_check_mark: | +| 2.5.x | :x: | + + +## Reporting a Vulnerability + +The Apache Software Foundation takes a rigorous standpoint in annihilating the security issues in its software projects. Apache Dubbo is highly sensitive and forthcoming to issues pertaining to its features and functionality. + +If you have apprehensions regarding Dubbo's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with the Apache Dubbo Security Team by dropping a mail at secur...@dubbo.apache.org. In the mail, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The Dubbo community will get back to you after assessing and analysing the findings. + +PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain. + +## VULNERABILITY HANDLING + +An overview of the vulnerability handling process is: + +* The reporter reports the vulnerability privately to Apache. +* The appropriate project's security team works privately with the reporter to resolve the vulnerability. +* A new release of the Apache product concerned is made that includes the fix. +* The vulnerability is publically announced. + +A more detailed description of the process can be found [here](https://www.apache.org/security/committers.html).
[dubbo] branch ralf0131-patch-1 created (now 86e7eaf)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch ralf0131-patch-1 in repository https://gitbox.apache.org/repos/asf/dubbo.git. at 86e7eaf Create security.md This branch includes the following new commits: new 86e7eaf Create security.md The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[dubbo.wiki] branch master updated: update status
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo.wiki.git The following commit(s) were added to refs/heads/master by this push: new cc7dfd6 update status cc7dfd6 is described below commit cc7dfd6f794db9082de8d18236c57865d618d28e Author: Huxing Zhang AuthorDate: Fri May 24 23:38:11 2019 +0800 update status --- Apache-Dubbo-external-ecosystem-status.md | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Apache-Dubbo-external-ecosystem-status.md b/Apache-Dubbo-external-ecosystem-status.md index 5c93f2b..1b78d66 100644 --- a/Apache-Dubbo-external-ecosystem-status.md +++ b/Apache-Dubbo-external-ecosystem-status.md @@ -1,8 +1,8 @@ The following table summarized the current status of Apache Dubbo external ecosystem, which has been listed under [here](https://github.com/dubbo). * Number of projects in total: 30 -* Number of projects finished: 17 -* Number of projects need to be transferred: 13 +* Number of projects finished: 20 +* Number of projects need to be transferred: 10 * Number of projects will be transferred to ASF: 14 (no later than Jun 30.) * Number of projects will be transferred to other group: 1 * Number of projects will be deleted: 1 @@ -21,14 +21,14 @@ The following table summarized the current status of Apache Dubbo external ecosy | serialization-native-hessian-for-apache-dubbo | Ian Luo | Yes| merge into incubator-dubbo | May 15 | Done | | jms-for-apache-dubbo | Kimm King | Yes| merge into incubator-dubbo | May 31 | Ongoing | | rpc-xmlrpc-for-apache-dubbo | Kimm King | Yes| merge into incubator-dubbo | May 10 | Done | -| php-framework-for-apache-dubbo | [robinkang](robink...@lexinfintech.com) | No | transfer to ASF | May 17 | SGA signed | -| js-for-apache-dubbo | @hufeng | No | transfer to ASF| May 10 | Ongoing | +| php-framework-for-apache-dubbo | [robinkang](robink...@lexinfintech.com) | No | transfer to ASF | May 17 | Done | +| js-for-apache-dubbo | @hufeng | No | transfer to ASF| May 10 | Done | | py-client-for-apache-dubbo | @JoeCao | No | transfer to qianmiopen | May 24 | Ongoing | | egg-dubbo-rpc | @gxcsoccer | No | transfer to eggjs | May 10 | Done | | dubbo-remoting-js | @gxcsoccer | No | transfer to eggjs | May 10 | Done | | dotnet-for-apache-dubbo | Kimm King | Yes| transfer to ASF| May 31 | Ongoing | | go-for-apache-dubbo | @AlexStocks | No | transfer to ASF| June 30 | Ongoing | -| dubbo-sentinel-support| @sczyh30 | No | transfer to ASF| May 10 | SGA/ICLA signed | +| dubbo-sentinel-support| @sczyh30 | No | transfer to ASF| May 10 | Done | | dubbo-kubernetes | Jeff Lv | Yes| transfer to ASF| -| Done | | dubbo-integration | Kimm King | Yes| remove | -| Done | | initializr| Zhixuan Chen | No | transfer
[dubbo-erlang] branch master updated (1612105 -> 9a9eef5)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-erlang.git. from 1612105 Merge pull request #5 from DLive/master new 2d99371 feature: add readonly event message feature. new a30e5af change eunit dep demo module new ebcb929 sample: upgrade dubbo to 2.7.1 new ae887cf improve: rename time_util,list_util new 644120d style: modify the ci and cover icon url new 9a9eef5 Merge pull request #7 from DLive/0.3.1 The 80 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: README.md | 4 +- config_example/sys.config | 4 +- include/dubbo.hrl | 114 ++--- samples/dubbo-sample-service/pom.xml | 31 +--- src/cotton_hessian.erl | 2 +- src/dubbo_consumer_pool.erl| 29 +++- ...ype_defined.erl => dubbo_java_type_defined.erl} | 2 +- src/{lists_util.erl => dubbo_lists_util.erl} | 2 +- src/dubbo_netty_client.erl | 15 +- src/dubbo_node_config_util.erl | 2 +- src/dubbo_serializa_hessian.erl| 29 +--- src/dubbo_serializa_json.erl | 2 +- src/{time_util.erl => dubbo_time_util.erl} | 2 +- src/{type_decoding.erl => dubbo_type_decoding.erl} | 2 +- src/{type_encoding.erl => dubbo_type_encoding.erl} | 4 +- src/{type_register.erl => dubbo_type_register.erl} | 2 +- src/dubbo_type_transfer.erl| 6 +- src/dubbo_zookeeper.erl| 4 +- src/dubboerl_app.erl | 4 +- test/consumer_SUITE.erl| 12 +- test/dubbo_common_fun_tests.erl| 8 +- ...dec_tests.erl => dubbo_consumer_pool_tests.erl} | 21 ++- .../include => test}/dubbo_sample_service.hrl | 8 +- .../src => test}/dubbo_sample_service_app.erl | 2 +- .../src => test}/dubbo_sample_service_sup.erl | 0 .../dubbo_sample_service_type_list.erl | 0 test/dubbo_service.hrl | 30 test/dubbo_service_app.erl | 51 -- test/dubbo_service_sup.erl | 46 -- test/dubbo_service_type_list.erl | 31 test/dubbo_service_user_impl.erl | 4 +- test/hessian_encode_tests.erl | 4 +- test/user2.erl | 181 - .../src => test}/userOperator.erl | 4 +- 34 files changed, 158 insertions(+), 504 deletions(-) rename src/{java_type_defined.erl => dubbo_java_type_defined.erl} (96%) rename src/{lists_util.erl => dubbo_lists_util.erl} (98%) rename src/{time_util.erl => dubbo_time_util.erl} (99%) rename src/{type_decoding.erl => dubbo_type_decoding.erl} (99%) rename src/{type_encoding.erl => dubbo_type_encoding.erl} (97%) rename src/{type_register.erl => dubbo_type_register.erl} (98%) copy test/{de_codec_tests.erl => dubbo_consumer_pool_tests.erl} (62%) copy {samples/dubboerl_demo/apps/dubbo_sample_service/include => test}/dubbo_sample_service.hrl (53%) copy {samples/dubboerl_demo/apps/dubbo_sample_service/src => test}/dubbo_sample_service_app.erl (96%) copy {samples/dubboerl_demo/apps/dubbo_sample_service/src => test}/dubbo_sample_service_sup.erl (100%) copy {samples/dubboerl_demo/apps/dubbo_sample_service/src => test}/dubbo_sample_service_type_list.erl (100%) delete mode 100644 test/dubbo_service.hrl delete mode 100644 test/dubbo_service_app.erl delete mode 100644 test/dubbo_service_sup.erl delete mode 100644 test/dubbo_service_type_list.erl delete mode 100644 test/user2.erl copy {samples/dubboerl_demo/apps/dubbo_sample_service/src => test}/userOperator.erl (97%)
[incubator-dubbo-js] branch master updated: rename js-for-apache-dubbo to dubbo-js
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new 09403a6 rename js-for-apache-dubbo to dubbo-js new 1318125 Merge pull request #116 from hufeng/master 09403a6 is described below commit 09403a6471b0836ac555a89a16206ff3854a588e Author: hufeng AuthorDate: Fri May 24 17:31:27 2019 +0800 rename js-for-apache-dubbo to dubbo-js --- README.md | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f82deca..08f5999 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# js-for-apache-dubbo +# dubbo-js --- @@ -6,9 +6,9 @@ [![NPM](https://nodei.co/npm/dubbo2.js.png?downloads=true=true=true)](https://nodei.co/npm/dubbo2.js) -js-for-apache-dubbo = Nodejs connected Java Dubbo service by dubbo protocol (dubbo head + hessian body) +dubbo-js = Nodejs connected Java Dubbo service by dubbo protocol (dubbo head + hessian body) -After all these years, js-for-apache-dubbo comes finally~ We love dubbo! +After all these years, dubbo-js comes finally~ We love dubbo! With core module [js-to-java](https://github.com/node-modules/js-to-java), and [hessian.js](https://github.com/node-modules/hessian.js), dubbo2 is finished. And many thanks to [fengmk2](https://github.com/fengmk2)和[dead-horse](https://github.com/dead-horse). @@ -312,7 +312,7 @@ app.beforeStart(async () => { }); ``` -# How to trace dubbo2.js runtime system info? +# How to trace dubbo-js runtime system info? ---
[incubator-dubbo-js] branch master updated: add docker-compose.yaml, add zookeeper cluster
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new bc8572c add docker-compose.yaml, add zookeeper cluster new 795f094 Merge pull request #115 from hufeng/master bc8572c is described below commit bc8572c6cd303bcd57fa98a9ce9a41c1b676d6c0 Author: hufeng AuthorDate: Fri May 24 17:10:28 2019 +0800 add docker-compose.yaml, add zookeeper cluster --- .vscode/settings.json | 3 +++ README.md | 27 --- docker-compose.yml | 31 ++ examples/hello-egg/app/dubbo/index.ts | 2 +- examples/hello-koa/dubbo/dubbo-es6.js | 2 +- examples/hello-koa/dubbo/dubbo.js | 2 +- .../META-INF/spring/dubbo-demo-provider.xml| 2 +- 7 files changed, 61 insertions(+), 8 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000..385f27a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "java.configuration.updateBuildConfiguration": "interactive" +} diff --git a/README.md b/README.md index b526a17..f82deca 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ With core module [js-to-java](https://github.com/node-modules/js-to-java), and [ 9. Typescript type definition -10. Convert java dubbo interface to typescript module by interpret tools +10. Convert java dubbo inter face to typescript module by interpret tools 11. SocketWorker was disconnected auto retry @@ -184,7 +184,7 @@ const errorProvider = ErrorProvider(dubbo); ({res, err} = await demoProvider.echo()); //print {err: null, res: 'pang'} ({res, err} = await demoProvider.getUserInfo()); - //print {status: 'ok', info: { id: '1', name: 'test' }} + //print {err: null, res: {status: 'ok', info: { id: '1', name: 'test' }} })(); ``` @@ -196,10 +196,10 @@ const errorProvider = ErrorProvider(dubbo); brew install zookeeper brew services start zookeeper -#Run test example in java/dubbo-demo-provider +# Run test example in java/dubbo-demo-provider yarn run test -#Full link log tracking +# Full link log tracking DEBUG=dubbo* yarn run test ``` @@ -644,3 +644,22 @@ import {Dubbo} from 'dubbo2.js/es6'; --- [Click here!](https://github.com/hufeng/iThink/tree/master/talk) + +# How to run example + +```sh +# start zookeeper cluster +docker-compose up + +# start java +cd java/dubbo-demo/dubbo-demo-provider +mvn clean package +java -jar target/dubbo-demo-provider-2.6.3-jar-with-dependencies.jar + +# start node +cd example/hello-koa +DEBUG=dubbo* node server.js + +# request /hello +curl http://localhost:3000/hello +``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000..2b64528 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: '2' +services: + zoo1: +image: zookeeper +restart: always +container_name: zoo1 +ports: + - '2181:2181' +environment: + ZOO_MY_ID: 1 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + + zoo2: +image: zookeeper +restart: always +container_name: zoo2 +ports: + - '2182:2181' +environment: + ZOO_MY_ID: 2 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + + zoo3: +image: zookeeper +restart: always +container_name: zoo3 +ports: + - '2183:2181' +environment: + ZOO_MY_ID: 3 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 diff --git a/examples/hello-egg/app/dubbo/index.ts b/examples/hello-egg/app/dubbo/index.ts index 3b2d679..b2e8da4 100644 --- a/examples/hello-egg/app/dubbo/index.ts +++ b/examples/hello-egg/app/dubbo/index.ts @@ -23,7 +23,7 @@ export default (app: EggApplication) => { const dubbo = new Dubbo({ application: {name: 'node-egg-bff'}, -register: 'localhost:2181', +register: 'localhost:2181,localhost:2182,localhost:2183', service, dubboSetting, }); diff --git a/examples/hello-koa/dubbo/dubbo-es6.js b/examples/hello-koa/dubbo/dubbo-es6.js index 26d3c89..0f35647 100644 --- a/examples/hello-koa/dubbo/dubbo-es6.js +++ b/examples/hello-koa/dubbo/dubbo-es6.js @@ -15,7 +15,7 @@ const dubboSetting = setting const dubbo = (module.exports = new Dubbo({ application: {name: 'dubbo-node-consumer1'}, - register: 'localhost:2181', + register: 'localhost:2181,localhost:2182,localhost:2183', service, dubboSetting, })); diff --git a/examples/hello-koa/dubbo/dubbo.js b/examples/hello-koa/dubbo/dubbo.js index a57aec9..3ecd539 100644 --- a/examples/hello-koa/dubbo/dubbo.js +++ b/examples/hello-koa/dubbo/dubbo.js @@ -15,7 +15,7 @@ const
[incubator-dubbo-js] branch master updated: doc: Translate the Chinese part of the translator's document into English
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new c2e0701 doc: Translate the Chinese part of the translator's document into English new 94b32f7 Merge pull request #113 from creasy2010/master c2e0701 is described below commit c2e07019877a560174171985bd53fd0f9797d51e Author: yangxiaodong AuthorDate: Fri May 24 14:31:51 2019 +0800 doc: Translate the Chinese part of the translator's document into English --- packages/interpret-cli/README.md | 58 ++-- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/packages/interpret-cli/README.md b/packages/interpret-cli/README.md index 083f868..2c924eb 100644 --- a/packages/interpret-cli/README.md +++ b/packages/interpret-cli/README.md @@ -2,17 +2,18 @@ http://oss-hz.qianmi.com/x-site/dev/doc/dong/video2deal/xsite/interpret/鹦鹉.png; width = "100" alt="图片名称" align=center /> -dubbo2.js 打通了 node 与 dubbo 服务调用的 rpc 通道 +Dubbo-js uses RPC to get through node and java. +If we can automatically generate Dubbo service interface definition, parameter conversion, and have automatic completion ability in ide, our development experience will be better. -调用 dubbo 接口时, 如果能自动生成接口定义,参数的转换,代码提示 开发体验会更优秀; +"Translator" came into being for this purpose! -"Translator(翻译师)" 为此而生!! +We will like it. -**_职责_** -1. 翻译 Interface 代码,生成 node 端可调用代码; -2. 自动将参数转换为 hessian.js 能识别的对象; -3. 接口方法及参数类型提示; +**_Duty_** + +1. Generate typescript code corresponding to Dubbo service interface; +2. Parametric conversion, converting JavaScript object to a format that hession. JS recognizes; ## TODO @@ -21,25 +22,23 @@ dubbo2.js 打通了 node 与 dubbo 服务调用的 rpc 通道 ## How to Usage? -如何把一个 dubbo 接口转换为 node 客户端能调用的代码,并在项目中使用呢?我们分为 3 个步骤: +We divide the whole process into three steps. + +1. Generate jar packages and install dependencies in Java API projects; -1. 在 java 接口项目生成 jar 包及依赖文件; -2. 从生成的 jar 字节码中提取 ast 信息,翻译师根据 ast 信息生成 typescript; -3. 项目中调用生成代码; +2. Extract ast information from generated jar bytecode, and then generate typescript based on it. -注: +3. Calling services; -具体实现 参考文档 [dubbo2js-翻译师.pdf](https://github.com/hufeng/iThink/blob/master/talk/dubbo2js-%E7%BF%BB%E8%AF%91%E5%B8%88.pdf) -### step1:从 java 项目生成 jar +### step1: ```shell -; 进入接口项目目录执行命令 mvn package mvn install dependency:copy-dependencies ``` -### step2:翻译生成 typescript 代码 +### step2: ```shell npm install interpret-dubbo2js -g @@ -57,14 +56,15 @@ dubbo.json: } ``` -| 参数名称 | 作用 | -| | | -| output | 生成代码保存路径 eg: [config example](../../examples/hello-egg/dubbo.json) | -| entry| 可选过滤无关代码 eg: [config example](../../examples/hello-egg/dubbo.json)| -| entryJarPath | 接口的 jar 包 eg: [config example](../../examples/hello-egg/dubbo.json) | -| libDirPath | 接口所依赖的eg: [config example](../../examples/hello-egg/dubbo.json) | +note: [Reference examples](../../examples/hello-egg); -**_Tip_** 生成的代码可以发 npm 包供其他业务线使用或直接在项目中引用 + +| parameter | affect | +| | | +| output | the dir to save output eg: [config example](../../examples/hello-egg/dubbo.json) | +| entry| package path filter eg: [config example](../../examples/hello-egg/dubbo.json)| +| entryJarPath | jar package for dubbo api eg: [config example](../../examples/hello-egg/dubbo.json) | +| libDirPath | the dubbo api dependencieseg: [config example](../../examples/hello-egg/dubbo.json) | ### step2:Use the provider @@ -89,9 +89,6 @@ showCaseProvider.show(); [interpret-example](https://github.com/creasy2010/interpret-example); - - - ## vocabulary explanation Note: The code snippet in the following explanation comes from @@ -618,4 +615,13 @@ function minusRedundancy(itemParam: any) { ``` +## FAQ: + +### q1:How to integrate with the project? + +**_Tip_** 生成的代码可以发 npm 包供其他业务线使用或直接在项目中引用 + +## Resources +[dubbo-js-Translator.pdf](https://github.com/hufeng/iThink/blob/master/talk/dubbo2js-%E7%BF%BB%E8%AF%91%E5%B8%88.pdf) +[interpret-example](https://github.com/creasy2010/interpret-example); \ No newline at end of file
[incubator-dubbo] branch master updated: [Dubbo-4115] When the network is reconnected, the listener should not to be empty. (#4116)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/master by this push: new 779fc27 [Dubbo-4115] When the network is reconnected, the listener should not to be empty. (#4116) 779fc27 is described below commit 779fc27255b30c07164b2db6978c71e7fea0b82f Author: yì jí AuthorDate: Thu May 23 17:40:30 2019 +0800 [Dubbo-4115] When the network is reconnected, the listener should not to be empty. (#4116) --- .../java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java b/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java index d0ec619..8f50017 100644 --- a/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java +++ b/dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClient.java @@ -278,7 +278,14 @@ public class JEtcdClient extends AbstractEtcdClient { } try { -this.listener = null; +/** + * issue : https://github.com/apache/incubator-dubbo/issues/4115 + * + * When the network is reconnected, the listener is empty + * and the data cannot be received. + */ +// this.listener = null; + if (watchRequest != null) { WatchCancelRequest watchCancelRequest = WatchCancelRequest.newBuilder().setWatchId(watchId).build();
[incubator-dubbo-website] branch asf-site updated: Update README.md (#366)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-website.git The following commit(s) were added to refs/heads/asf-site by this push: new 0d2f3c5 Update README.md (#366) 0d2f3c5 is described below commit 0d2f3c5662779136d0c5a7734662c437646a0679 Author: Jlcao AuthorDate: Wed May 22 21:24:34 2019 +0800 Update README.md (#366) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8e2d2d..e99b88f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Please also make sure your node version is 8.x, versions higher than 8.x is not 2. Run `npm i` in the root directory to install the dependencies. 3. Run `docsite start` in the root directory to start a local server, you will see the website in 'http://127.0.0.1:8080'. 4. Run `docsite build` to build source code. -5. Verify your change locally: `python -m SimpleHTTPServer 8000` +5. Verify your change locally: `python -m SimpleHTTPServer 8000`, when your python version is 3 use :`python3 -m http.server 8000` instead. ## How to send a PR
[incubator-dubbo] branch master updated: Add dependencies check script (#3941)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/master by this push: new 3fc6909 Add dependencies check script (#3941) 3fc6909 is described below commit 3fc69095cfa6d1acb604260f843627bc61abf6a3 Author: Huang YunKun AuthorDate: Wed May 22 10:57:19 2019 +0800 Add dependencies check script (#3941) * add plugin to do dependencies check * remove third-party properties file * polish config * polish config * use missing info in bash --- .gitignore | 5 ++- licenseCheck.sh | 96 + pom.xml | 35 + 3 files changed, 135 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0938f78..8989935 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,7 @@ Thumbs.db *.orig # flatten ignore -.flattened-pom.xml \ No newline at end of file +.flattened-pom.xml + +# license check result +license-list.txt \ No newline at end of file diff --git a/licenseCheck.sh b/licenseCheck.sh new file mode 100755 index 000..9992f10 --- /dev/null +++ b/licenseCheck.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +APPEND_ARG="" +FOLDER="./" +LINE_FLAG="==" +TARGET_FILE="./license-list.txt" + +red=`tput setaf 1` +green=`tput setaf 2` +reset=`tput sgr0` + + +if [ -n "$1" ]; then +echo "checking module $1" +APPEND_ARG="-f $1" +FOLDER="$1" +else +echo "checking whole project" +fi + +echo "Running command: ./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG" + +./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG + +status=$? +if [ $status -eq 0 ]; then + echo "mvn command exec success" +else + echo "${red}mvn command exec fail${reset}" + exit 1 +fi + + +#contact and generate license file +rm -rf $TARGET_FILE +LICENSE_FILES=`find $FOLDER -type f -name "THIRD-PARTY.txt"|grep generated-sources` + +echo "Find license files:" +echo "$LICENSE_FILES" + +for i in $LICENSE_FILES +do +echo "$LINE_FLAG" >> $TARGET_FILE +echo $i >> $TARGET_FILE +cat $i >> $TARGET_FILE +done + +echo "license files generated at $TARGET_FILE" + +#fix missing license dependencies +missingLicense=( +"(Unknown license) jsr173_api:(Apache License, Version 2.0) jsr173_api" +"(Unknown license) \"Java Concurrency in Practice\" book annotations:(BEA licensed) \"Java Concurrency in Practice\" book annotations" +"(Unknown license) Java Portlet Specification V2.0:(Apache License, Version 2.0) Java Portlet Specification V2.0" +) + +for i in "${missingLicense[@]}"; do +search=`echo $i |awk -F: '{print $1}'` +replace=`echo $i |awk -F: '{print $2}'` +sed -i -e 's/'"$search"'/'"$replace"'/g' $TARGET_FILE +done + +check_unknown_license=`cat $TARGET_FILE | grep "Unknown license"` + +#checking unknown license +if grep -q "Unknown license" $TARGET_FILE +then +echo "${red}Find unknown license${reset}" +echo "$check_unknown_license" +exit 1 +fi + +allowLicense=( +"CDDL" +"Apache" +"Common Development and Distribution License" +"Eclipse Public License" +"MIT" +"The 3-Clause BSD License" +"Public domain" +) + +#filter allow license +license_need_check=`cat $TARGET_FILE | grep -v "generated-sources/license/THIRD-PARTY.txt" | grep -v "third-party dependencies" | grep -v $LINE_FLAG` + +for i in "${allowLicense[@]}"; do +license_need_check=`echo "$license_need_check"|grep -vi "$i"` +done + +if test -z "$license_need_check" +then +echo "${green}All dependencies license looks good${reset}" +else +echo "${red}Please check below license${reset}" +echo "$license_need_check" +fi \ No newline at end of file diff --git a/pom.xml b/pom.xml index a1f7b56..e9a1661 100644 --- a/pom.xml +++ b/pom.xml @@ -302,6 +302,41 @@ + +licenseCheck + + + +org.codehaus.mojo +license-maven-plugin +1.20 + + +license-check +generate-sources + +add-third-party + +
[incubator-dubbo-erlang] branch master updated (f35e246 -> 1612105)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-erlang.git. from f35e246 Merge pull request #3 from DLive/master new e283e75 add apache-2.0 license header and formatting fixed #4 new 685b388 add apache-2.0 license header new 1612105 Merge pull request #5 from DLive/master The 74 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: Developer.md | 45 --- include/common.hrl | 26 +- include/dubbo.hrl | 26 +- include/dubbo_type.hrl | 27 +- include/dubboerl.hrl | 27 +- include/hessian.hrl| 15 + include/java_type.hrl | 26 +- .../apache/dubbo/erlang/sample/service/App.java| 25 +- .../dubbo/erlang/sample/service/AppListMain.java | 23 +- .../dubbo/erlang/sample/service/bean/UserInfo.java | 17 + .../sample/service/bean/UserInfoRequest.java | 20 +- .../dubbo/erlang/sample/service/bean/UserRes.java | 20 +- .../erlang/sample/service/facade/UserOperator.java | 20 ++ .../sample/service/impl/UserOperatorImpl.java | 19 +- .../src/main/resources/applicationProvider.xml | 19 +- .../src/main/resources/log4j.properties| 1 - .../dubbo/erlang/sample/service/AppTest.java | 25 +- src/dubbo_adapter.erl | 53 ++-- src/dubbo_codec.erl| 165 +- src/dubbo_common.erl | 25 +- src/dubbo_common_fun.erl | 35 +- src/dubbo_config_util.erl | 61 ++-- src/dubbo_consumer_pool.erl| 172 +- src/dubbo_consumer_pool_sup.erl| 35 +- src/dubbo_heartbeat.erl| 39 ++- src/dubbo_id_generator.erl | 55 ++-- src/dubbo_invoker.erl | 127 src/dubbo_netty_client.erl | 351 +++-- src/dubbo_network_tools.erl| 41 ++- src/dubbo_node_config_util.erl | 129 src/dubbo_provider_protocol.erl| 184 +-- src/dubbo_provider_worker.erl | 79 ++--- src/dubbo_provider_worker_sup.erl | 25 +- src/dubbo_serializa_hessian.erl| 277 src/dubbo_serializa_json.erl | 272 src/dubbo_traffic_control.erl | 29 +- src/dubbo_type_transfer.erl| 74 +++-- src/dubbo_zookeeper.erl| 158 +- src/dubboerl.app.src | 28 +- src/dubboerl.erl | 69 ++-- src/dubboerl_app.erl | 35 +- src/dubboerl_sup.erl | 41 ++- src/java_type_defined.erl | 32 +- src/lists_util.erl | 30 +- src/time_util.erl | 58 ++-- src/type_decoding.erl | 112 +++ src/type_encoding.erl | 38 +-- src/type_register.erl | 44 +-- test/consumer_SUITE.erl| 100 +++--- test/de_codec_tests.erl| 28 +- test/dubbo_adapter_tests.erl | 67 ++-- test/dubbo_common_fun_tests.erl| 46 +-- test/dubbo_config_parser_tests.erl | 40 ++- test/dubbo_heartbeat_tests.erl | 36 ++- test/dubbo_service.hrl | 34 +- test/dubbo_service_app.erl | 29 +- test/dubbo_service_sup.erl | 23 +- test/dubbo_service_type_list.erl | 28 +- test/dubbo_service_user_impl.erl | 56 ++-- test/dubbo_traffic_control_tests.erl | 38 ++- test/dubbo_zookeeper_tests.erl | 34 +- test/hessian_encode_tests.erl | 52 +-- test/user2.erl | 138 .../java/org/apache/dubbo/erlang/analysis/App.java | 45 ++- .../org/apache/dubbo/erlang/analysis/Start.java| 17 + .../dubbo/erlang/analysis/erltool/UserInfo.java| 22 +- .../analysis/generater/ErlProjectGenerater.java| 105 +++--- .../erlang/analysis/generater/ProjectInfo.java | 24 +- .../e
[incubator-dubbo-js] branch master updated (5558d6e -> 74ada68)
This is an automated email from the ASF dual-hosted git repository. huxing pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git. from 5558d6e Merge pull request #111 from hufeng/master new b052179 add: 1. add node client 2. add vocabulary explanation new d772bbc add: 1. add vocabulary explanation new 972b47d refactor: regenerator dubbo nodejs client new f0d0d97 del: del redundant files new 576f3a6 add: add Regenerate docement new fb39e77 add: add Regenerate docement new e580843 add link new 3dad1ae add: add Regenerate docement new a279d27 add: add Regenerate docement new 94dec5b add: add Regenerate docement new a52cb4d modify: change example info new 74ada68 Merge pull request #112 from creasy2010/master The 306 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: examples/hello-egg/README.md |10 +- .../com/alibaba/dubbo/demo/BasicTypeProvider.ts| 6 +- .../com/alibaba/dubbo/demo/DemoProvider.ts | 6 +- .../com/alibaba/dubbo/demo/ErrorProvider.ts| 4 +- .../com/alibaba/dubbo/demo/TypeRequest.ts | 6 +- .../com/alibaba/dubbo/demo/UserRequest.ts | 2 + .../com/alibaba/dubbo/demo/UserResponse.ts | 2 + examples/hello-egg/dubbo.json | 7 + examples/hello-egg/package-lock.json | 10306 +++ examples/hello-egg/package.json| 3 + packages/interpret-cli/README.md | 543 +- 11 files changed, 10882 insertions(+), 13 deletions(-) create mode 100644 examples/hello-egg/dubbo.json create mode 100644 examples/hello-egg/package-lock.json
[incubator-dubbo-js] branch master updated: use prettier to format setting module
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new 4f5f63c use prettier to format setting module new 5558d6e Merge pull request #111 from hufeng/master 4f5f63c is described below commit 4f5f63c7927377eab75ade3a88d7de3c6b50c4ba Author: hufeng AuthorDate: Tue May 21 10:54:03 2019 +0800 use prettier to format setting module --- packages/dubbo/src/setting/index.ts | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/dubbo/src/setting/index.ts b/packages/dubbo/src/setting/index.ts index 7f25d9c..d55be29 100644 --- a/packages/dubbo/src/setting/index.ts +++ b/packages/dubbo/src/setting/index.ts @@ -27,10 +27,10 @@ const log = debug('dubbo:dubbo-setting'); * 多么想要一个ReasonML的match-pattern */ export class Setting { - private readonly _rules: Map> = new Map>() - .set("Array", new Array()) - .set("RegExp", new Array()) - .set("TPredictFunction", new Array()); + private readonly _rules: Map> = new Map() +.set('Array', new Array()) +.set('RegExp', new Array()) +.set('TPredictFunction', new Array()); private _cache: Map = new Map(); /** @@ -51,13 +51,13 @@ export class Setting { log('add match rule %j', rule); if (isString(arg)) { rule.condition = [arg]; - this._rules.get("Array").push(rule); + this._rules.get('Array').push(rule); } else if (isArray(arg)) { - this._rules.get("Array").push(rule); + this._rules.get('Array').push(rule); } else if (isFn(arg)) { - this._rules.get("TPredictFunction").push(rule); + this._rules.get('TPredictFunction').push(rule); } else if (isRegExp(arg)) { - this._rules.get("RegExp").push(rule); + this._rules.get('RegExp').push(rule); } return this; } @@ -69,7 +69,7 @@ export class Setting { } let matchedRule = null; if (!matchedRule) { - for (let rule of this._rules.get("Array")) { + for (let rule of this._rules.get('Array')) { if (isArray(rule.condition) && rule.condition.indexOf(dubboInterface)) { matchedRule = rule; break; @@ -77,7 +77,7 @@ export class Setting { } } if (!matchedRule) { - for (let rule of this._rules.get("TPredictFunction")) { + for (let rule of this._rules.get('TPredictFunction')) { if (isFn(rule.condition) && rule.condition(dubboInterface)) { matchedRule = rule; break; @@ -86,7 +86,7 @@ export class Setting { } if (!matchedRule) { - for (let rule of this._rules.get("RegExp")) { + for (let rule of this._rules.get('RegExp')) { if (isRegExp(rule.condition) && rule.condition.test(dubboInterface)) { matchedRule = rule; break; @@ -95,10 +95,10 @@ export class Setting { } if (matchedRule) { log( - '%s =match=> rule %s result=> %j', - dubboInterface, - matchedRule.condition, - matchedRule.dubboSetting, +'%s =match=> rule %s result=> %j', +dubboInterface, +matchedRule.condition, +matchedRule.dubboSetting, ); this._cache.set(dubboInterface, matchedRule.dubboSetting); return matchedRule.dubboSetting;
[incubator-dubbo-js] branch master updated: dubbo-invoker add cache
This is an automated email from the ASF dual-hosted git repository. huxing pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-js.git The following commit(s) were added to refs/heads/master by this push: new 28dedc4 dubbo-invoker add cache new a946e25 Merge pull request #110 from hufeng/master 28dedc4 is described below commit 28dedc40b380ca41d3d609e80f67383c35f2eecd Author: hufeng AuthorDate: Tue May 21 10:23:29 2019 +0800 dubbo-invoker add cache --- packages/dubbo-invoker/src/matcher.ts | 6 ++ 1 file changed, 6 insertions(+) diff --git a/packages/dubbo-invoker/src/matcher.ts b/packages/dubbo-invoker/src/matcher.ts index 4f14a1e..1119a3e 100644 --- a/packages/dubbo-invoker/src/matcher.ts +++ b/packages/dubbo-invoker/src/matcher.ts @@ -28,6 +28,7 @@ const log = debug('dubbo:dubbo-invoker'); */ export class Matcher { private readonly _rules: Array = []; + private readonly _cache: Map = new Map(); /** * 匹配规则 @@ -55,6 +56,11 @@ export class Matcher { //获取当前context的dubbo接口 const {dubboInterface} = ctx; +// get from cache +if (this._cache.has(dubboInterface)) { + return this._cache.get(dubboInterface); +} + for (let rule of this._rules) { const {condition, invokeParam} = rule;