[incubator-dubbo] branch 2.6.x updated: Qos enhancement, take #2153 back to 2.6.x (#2455)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a commit to branch 2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/2.6.x by this push: new 97d20a3 Qos enhancement, take #2153 back to 2.6.x (#2455) 97d20a3 is described below commit 97d20a362284623f2220f834c7e6498ffe3c951b Author: Jerrick Zhu AuthorDate: Thu Sep 6 11:45:34 2018 +0800 Qos enhancement, take #2153 back to 2.6.x (#2455) --- .../com/alibaba/dubbo/config/ApplicationConfig.java | 3 +++ .../alibaba/dubbo/qos/protocol/QosProtocolWrapper.java | 17 + .../dubbo/registry/integration/RegistryProtocol.java| 17 - 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ApplicationConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ApplicationConfig.java index 9238a11..523e005 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ApplicationConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ApplicationConfig.java @@ -71,10 +71,13 @@ public class ApplicationConfig extends AbstractConfig { // directory for saving thread dump private String dumpDirectory; +// whether to enable qos or not private Boolean qosEnable; +// the qos port to listen private Integer qosPort; +// should we accept foreign ip or not? private Boolean qosAcceptForeignIp; // customized parameters diff --git a/dubbo-plugin/dubbo-qos/src/main/java/com/alibaba/dubbo/qos/protocol/QosProtocolWrapper.java b/dubbo-plugin/dubbo-qos/src/main/java/com/alibaba/dubbo/qos/protocol/QosProtocolWrapper.java index 26692cc..73d1f56 100644 --- a/dubbo-plugin/dubbo-qos/src/main/java/com/alibaba/dubbo/qos/protocol/QosProtocolWrapper.java +++ b/dubbo-plugin/dubbo-qos/src/main/java/com/alibaba/dubbo/qos/protocol/QosProtocolWrapper.java @@ -18,6 +18,8 @@ package com.alibaba.dubbo.qos.protocol; import com.alibaba.dubbo.common.Constants; import com.alibaba.dubbo.common.URL; +import com.alibaba.dubbo.common.logger.Logger; +import com.alibaba.dubbo.common.logger.LoggerFactory; import com.alibaba.dubbo.qos.server.Server; import com.alibaba.dubbo.rpc.Exporter; import com.alibaba.dubbo.rpc.Invoker; @@ -29,8 +31,12 @@ import java.util.concurrent.atomic.AtomicBoolean; import static com.alibaba.dubbo.common.Constants.ACCEPT_FOREIGN_IP; import static com.alibaba.dubbo.common.Constants.QOS_ENABLE; import static com.alibaba.dubbo.common.Constants.QOS_PORT; +import static com.alibaba.dubbo.qos.common.QosConstants.DEFAULT_PORT; public class QosProtocolWrapper implements Protocol { + +private final Logger logger = LoggerFactory.getLogger(QosProtocolWrapper.class); + private static AtomicBoolean hasStarted = new AtomicBoolean(false); private Protocol protocol; @@ -76,20 +82,23 @@ public class QosProtocolWrapper implements Protocol { } try { -boolean qosEnable = Boolean.parseBoolean(url.getParameter(QOS_ENABLE,"true")); +boolean qosEnable = url.getParameter(QOS_ENABLE,true); if (!qosEnable) { +logger.info("qos won't be started because it is disabled. " + +"Please check dubbo.application.qos.enable is configured either in system property, " + +"dubbo.properties or XML/spring boot configuration."); return; } -int port = Integer.parseInt(url.getParameter(QOS_PORT,"2")); -boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"true")); +int port = url.getParameter(QOS_PORT, DEFAULT_PORT); +boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"false")); Server server = com.alibaba.dubbo.qos.server.Server.getInstance(); server.setPort(port); server.setAcceptForeignIp(acceptForeignIp); server.start(); } catch (Throwable throwable) { -//throw new RpcException("fail to start qos server", throwable); +logger.warn("Fail to start qos server: ", throwable); } } } diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java index fd414ed..e1a59b9 100644 --- a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java +++ b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java @@ -135,26 +135,26 @@ public class RegistryProtocol implements Protocol { //registry provider
[incubator-dubbo] branch 2.6.x updated: upgrade javadoc to 3.0.1 (#2454)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a commit to branch 2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/2.6.x by this push: new 7ece161 upgrade javadoc to 3.0.1 (#2454) 7ece161 is described below commit 7ece1615389174d091b194b46baceb41a7ed4946 Author: Jerrick Zhu AuthorDate: Thu Sep 6 11:11:36 2018 +0800 upgrade javadoc to 3.0.1 (#2454) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69aa46e..43a160c 100644 --- a/pom.xml +++ b/pom.xml @@ -115,7 +115,7 @@ 2.8.2 3.6.0 3.0.1 -3.0.0 +3.0.1 6.1.26 3.0.0 0.8.1
[incubator-dubbo] branch 2.6.x updated: fix telnet invoke NPE #2218 (#2273) (#2453)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a commit to branch 2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/2.6.x by this push: new 52e9290 fix telnet invoke NPE #2218 (#2273) (#2453) 52e9290 is described below commit 52e9290d12162d1d483b21070729e7f2c6a04733 Author: Jerrick Zhu AuthorDate: Thu Sep 6 09:57:44 2018 +0800 fix telnet invoke NPE #2218 (#2273) (#2453) --- .../protocol/dubbo/telnet/InvokeTelnetHandler.java | 13 .../rpc/protocol/dubbo/support/DemoService.java| 2 ++ .../protocol/dubbo/support/DemoServiceImpl.java| 5 +++ .../dubbo/telnet/InvokerTelnetHandlerTest.java | 36 ++ 4 files changed, 56 insertions(+) diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java index 47f11f5..59733dc 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java @@ -60,6 +60,19 @@ public class InvokeTelnetHandler implements TelnetHandler { for (int i = 0; i < types.length; i++) { Class type = types[i]; Object arg = args.get(i); + +if (arg == null) { +// if the type is primitive, the method to invoke will cause NullPointerException definitely +// so we can offer a specified error message to the invoker in advance and avoid unnecessary invoking +if (type.isPrimitive()) { +throw new NullPointerException(String.format( +"The type of No.%d parameter is primitive(%s), but the value passed is null.", i + 1, type.getName())); +} + +// if the type is not primitive, we choose to believe what the invoker want is a null value +continue; +} + if (ReflectUtils.isPrimitive(arg.getClass())) { if (!ReflectUtils.isPrimitive(type)) { return false; diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java index 182a1e8..93c48f5 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java @@ -57,4 +57,6 @@ public interface DemoService { NonSerialized returnNonSerialized(); +long add(int a, long b); + } \ No newline at end of file diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java index 93c9764..50d98e6 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java @@ -103,4 +103,9 @@ public class DemoServiceImpl implements DemoService { public NonSerialized returnNonSerialized() { return new NonSerialized(); } + +public long add(int a, long b) { +return a + b; +} + } \ No newline at end of file diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java index 04092d0..9dfc20f 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -70,6 +71,41 @@ public class InvokerTelnetHandlerTest { @SuppressWarnings("unchecked") @Test +public void testInvokeByPassingNullValue() throws RemotingException { +mockInvoker = mock(Invoker.class); +given(mockInvoker.getInterface()).willReturn(DemoService.class); + given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo")); +
[incubator-dubbo] branch telnet-npe-2.6.x deleted (was 2ca0af7)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a change to branch telnet-npe-2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git. was 2ca0af7 fix telnet invoke NPE #2218 (#2273) This change permanently discards the following revisions: discard 2ca0af7 fix telnet invoke NPE #2218 (#2273)
[incubator-dubbo] branch telnet-npe-2.6.x created (now 2ca0af7)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a change to branch telnet-npe-2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git. at 2ca0af7 fix telnet invoke NPE #2218 (#2273) This branch includes the following new commits: new 2ca0af7 fix telnet invoke NPE #2218 (#2273) 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.
[incubator-dubbo] 01/01: fix telnet invoke NPE #2218 (#2273)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a commit to branch telnet-npe-2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git commit 2ca0af73942d2c9ebcb3ead8eecdc0940bd7bb43 Author: Michael Chow AuthorDate: Fri Aug 17 11:12:21 2018 +0800 fix telnet invoke NPE #2218 (#2273) * fix issue #2218 * add some unit tests --- .../protocol/dubbo/telnet/InvokeTelnetHandler.java | 13 .../rpc/protocol/dubbo/support/DemoService.java| 2 ++ .../protocol/dubbo/support/DemoServiceImpl.java| 5 +++ .../dubbo/telnet/InvokerTelnetHandlerTest.java | 36 ++ 4 files changed, 56 insertions(+) diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java index 47f11f5..59733dc 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java @@ -60,6 +60,19 @@ public class InvokeTelnetHandler implements TelnetHandler { for (int i = 0; i < types.length; i++) { Class type = types[i]; Object arg = args.get(i); + +if (arg == null) { +// if the type is primitive, the method to invoke will cause NullPointerException definitely +// so we can offer a specified error message to the invoker in advance and avoid unnecessary invoking +if (type.isPrimitive()) { +throw new NullPointerException(String.format( +"The type of No.%d parameter is primitive(%s), but the value passed is null.", i + 1, type.getName())); +} + +// if the type is not primitive, we choose to believe what the invoker want is a null value +continue; +} + if (ReflectUtils.isPrimitive(arg.getClass())) { if (!ReflectUtils.isPrimitive(type)) { return false; diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java index 182a1e8..93c48f5 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoService.java @@ -57,4 +57,6 @@ public interface DemoService { NonSerialized returnNonSerialized(); +long add(int a, long b); + } \ No newline at end of file diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java index 93c9764..50d98e6 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/support/DemoServiceImpl.java @@ -103,4 +103,9 @@ public class DemoServiceImpl implements DemoService { public NonSerialized returnNonSerialized() { return new NonSerialized(); } + +public long add(int a, long b) { +return a + b; +} + } \ No newline at end of file diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java index 04092d0..9dfc20f 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/test/java/com/alibaba/dubbo/rpc/protocol/dubbo/telnet/InvokerTelnetHandlerTest.java @@ -33,6 +33,7 @@ import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; import static org.mockito.Mockito.mock; @@ -70,6 +71,41 @@ public class InvokerTelnetHandlerTest { @SuppressWarnings("unchecked") @Test +public void testInvokeByPassingNullValue() throws RemotingException { +mockInvoker = mock(Invoker.class); +given(mockInvoker.getInterface()).willReturn(DemoService.class); + given(mockInvoker.getUrl()).willReturn(URL.valueOf("dubbo://127.0.0.1:20883/demo")); +given(mockInvoker.invoke(any(Invocation.class))).willReturn(new RpcResult("ok")); +mockChannel = mock(Channel.class); +
[incubator-dubbo] branch 2.6.x updated: Direct return when the server goes down unnormally. (#2451)
This is an automated email from the ASF dual-hosted git repository. jerrick pushed a commit to branch 2.6.x in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git The following commit(s) were added to refs/heads/2.6.x by this push: new 8ae95c9 Direct return when the server goes down unnormally. (#2451) 8ae95c9 is described below commit 8ae95c954228f1637d21b037df218a3ed94231c7 Author: 时无两丶 <442367...@qq.com> AuthorDate: Thu Sep 6 09:26:12 2018 +0800 Direct return when the server goes down unnormally. (#2451) --- .../alibaba/dubbo/remoting/exchange/Response.java | 5 + .../remoting/exchange/support/DefaultFuture.java | 23 ++ .../support/header/HeaderExchangeHandler.java | 1 + 3 files changed, 29 insertions(+) diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/Response.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/Response.java index 0422a06..d01d20d 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/Response.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/Response.java @@ -41,6 +41,11 @@ public class Response { public static final byte SERVER_TIMEOUT = 31; /** + * channel inactive, directly return the unfinished requests. + */ +public static final byte CHANNEL_INACTIVE = 35; + +/** * request format error. */ public static final byte BAD_REQUEST = 40; diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/DefaultFuture.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/DefaultFuture.java index eccc86d..a72fadc 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/DefaultFuture.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/DefaultFuture.java @@ -90,6 +90,29 @@ public class DefaultFuture implements ResponseFuture { } } +/** + * close a channel when a channel is inactive + * directly return the unfinished requests. + * + * @param channel channel to close + */ +public static void closeChannel(Channel channel) { +for (long id : CHANNELS.keySet()) { +if (channel.equals(CHANNELS.get(id))) { +DefaultFuture future = getFuture(id); +if (future != null && !future.isDone()) { +Response disconnectResponse = new Response(future.getId()); +disconnectResponse.setStatus(Response.CHANNEL_INACTIVE); +disconnectResponse.setErrorMessage("Channel " + +channel + +" is inactive. Directly return the unFinished request : " + +future.getRequest()); +DefaultFuture.received(channel, disconnectResponse); +} +} +} +} + public static void received(Channel channel, Response response) { try { DefaultFuture future = FUTURES.remove(response.getId()); diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java index 3c37817..f44318f 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java @@ -123,6 +123,7 @@ public class HeaderExchangeHandler implements ChannelHandlerDelegate { try { handler.disconnected(exchangeChannel); } finally { +DefaultFuture.closeChannel(channel); HeaderExchangeChannel.removeChannelIfDisconnected(channel); } }
[incubator-dubbo-website] branch asf-site updated: update quick start doc
This is an automated email from the ASF dual-hosted git repository. iluo 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 a3fa315 update quick start doc a3fa315 is described below commit a3fa315e023488c7fa7b5c0147f15fa90012d731 Author: beiwei30 AuthorDate: Wed Sep 5 15:46:40 2018 +0800 update quick start doc --- build/blog.js| 6 +++--- build/blogDetail.js | 6 +++--- build/community.js | 6 +++--- build/documentation.js | 6 +++--- build/home.js| 6 +++--- docs/en-us/user/quick-start.md | 5 ++--- docs/zh-cn/user/quick-start.md | 2 +- en-us/docs/user/quick-start.html | 7 +++ en-us/docs/user/quick-start.json | 2 +- zh-cn/docs/user/quick-start.html | 4 ++-- zh-cn/docs/user/quick-start.json | 2 +- 11 files changed, 25 insertions(+), 27 deletions(-) diff --git a/build/blog.js b/build/blog.js index bd221da..9fa054f 100644 --- a/build/blog.js +++ b/build/blog.js @@ -1,6 +1,6 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/build/",t(t.s=77) [...] - Copyright (c) 2017 Jed Watson. +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/build/",t(t.s=79) [...] + Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ -!function(){"use strict";function n(){for(var e=[],t=0;thttp://jedwatson.github.io/classnames */ -!function(){"use strict";function n(){for(var e=[],t=0;thttp://jedwatson.github.io/classnames */ -!function(){"use strict";function n(){for(var e=[],t=0;thttp://jedwatson.github.io/classnames */ -!function(){"use strict";function n(){for(var e=[],t=0;thttp://jedwatson.github.io/classnames */ -!function(){"use strict";function n(){for(var e=[],t=0;thttps://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/xsd-configuration.html). -The following content will guide you to start dubbo using Spring configuration. +If you don't want to rely on Spring, you can try using [API configuration](./configuration/api.md). First let's create a root directory called dubbo-demo: diff --git a/docs/zh-cn/user/quick-start.md b/docs/zh-cn/user/quick-start.md index 3bb484b..03370e9 100644 --- a/docs/zh-cn/user/quick-start.md +++ b/docs/zh-cn/user/quick-start.md @@ -1,7 +1,7 @@ # 快速启动 -Dubbo 采用全 Spring 配置方式,透明化接入应用,对应用没有任何 API 侵入,只需用 Spring 加载 Dubbo 的配置即可,Dubbo 基于 Spring 的 Schema 扩展进行加载。 +Dubbo 采用全 Spring 配置方式,透明化接入应用,对应用没有任何 API 侵入,只需用 Spring 加载 Dubbo 的配置即可,Dubbo 基于 [Spring 的 Schema 扩展](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/xsd-configuration.html) 进行加载。 如果不想使用 Spring 配置,可以通过 [API 的方式](./configuration/api.md) 进行调用。 diff --git a/en-us/docs/user/quick-start.html b/en-us/docs/user/quick-start.html index 3b6df81..0679d6c 100644 --- a/en-us/docs/user/quick-start.html +++ b/en-us/docs/user/quick-start.html @@ -12,10 +12,9 @@ - 中API configuration. -The following content will guide you to start dubbo using Spring configuration. + 中https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/xsd-configuration.html;>XML configuration. +If you don't want to rely on Spring, you can try using API configuration. First let's create a root directory called dubbo-demo: mkdir dubbo-demo cd dubbo-demo diff --git a/en-us/docs/user/quick-start.json b/en-us/docs/user/quick-start.json index dc6cbaa..d5e84e9 100644 --- a/en-us/docs/user/quick-start.json +++ b/en-us/docs/user/quick-start.json @@ -1,4 +1,4 @@ { "filename": "quick-start.md", - "__html": "Quick start\nThe most common way to configure Dubbo is to use Spring.\nIf you don't want to use the Spring configuration, you can try using API configuration.\nThe following content will guide you to start dubbo using Spring configuration.\nFirst let's create a root directory called dubbo-demo:\nmkdir dubbo-demo\ncd dubbo-demo\n\nNext, we are going to create 3 sub-directories unde [...] + "__html": "Quick start\nThe
[incubator-dubbo] branch master updated: Readme (#2449)
This is an automated email from the ASF dual-hosted git repository. iluo 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 ff36fb0 Readme (#2449) ff36fb0 is described below commit ff36fb0d5ab175b8a90fd717692c9c49f934ef8a Author: Ian Luo AuthorDate: Wed Sep 5 14:55:54 2018 +0800 Readme (#2449) * update README * update README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ed5d8d..463a111 100644 --- a/README.md +++ b/README.md @@ -182,12 +182,13 @@ Please follow the [template](https://github.com/apache/incubator-dubbo/issues/ne Please report security vulnerability to secur...@dubbo.incubator.apache.org (private mailing list). -## [Ecosystem](https://github.com/dubbo) +## Dubbo eco system +* [Dubbo Ecosystem Entry](https://github.com/dubbo) - A GitHub group `dubbo` to gather all Dubbo relevant projects not appropriate in [apache](https://github.com/apache) group yet * [Dubbo Website](https://github.com/apache/incubator-dubbo-website) - Apache Dubbo (incubating) official website * [Dubbo Samples](https://github.com/dubbo/dubbo-samples) - samples for Apache Dubbo (incubating) * [Dubbo Spring Boot](https://github.com/apache/incubator-dubbo-spring-boot-project) - Spring Boot Project for Dubbo -* [Dubbo OPS](https://github.com/apache/incubator-dubbo-ops) - The reference implementation for dubbo ops (dubbo-admin, dubbo-monitor, dubbo-registry-simple, etc.) +* [Dubbo OPS](https://github.com/apache/incubator-dubbo-ops) - The reference implementation for Dubbo admin Language
[incubator-dubbo] branch master updated: update README (#2448)
This is an automated email from the ASF dual-hosted git repository. iluo 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 96cdf13 update README (#2448) 96cdf13 is described below commit 96cdf134c041f2f1f8a481ccb2c2faa338a1060f Author: Ian Luo AuthorDate: Wed Sep 5 14:47:08 2018 +0800 update README (#2448) --- README.md | 46 -- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e5d2f68..3ed5d8d 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,15 @@ 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/dubbo/dubbo-samples/tree/master/dubbo-samples-api). You may clone the sample project and step into `dubbo-samples-api` sub directory before read on. + +```bash +# git clone https://github.com/dubbo/dubbo-samples.git +# cd dubbo-samples/dubbo-samples-api +``` + +There's one [README](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samples-api/README.md) file under `dubbo-samples-api` directory. Read it and try this sample out by following the instructions. + ### Maven dependency ```xml @@ -35,17 +44,19 @@ We are now collecting dubbo user info in order to help us to improve dubbo bette ``` -### Defining service interfaces +### Define service interfaces ```java -package org.apache.dubbo.demo; +package org.apache.dubbo.demo.api; public interface GreetingService { String sayHello(String name); } ``` -### Implement interface in service provider +*See [api/GreetingService.java](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samples-api/src/main/java/com/alibaba/dubbo/samples/api/GreetingsService.java) on GitHub.* + +### Implement service interface for the provider ```java package org.apache.dubbo.demo.provider; @@ -59,7 +70,9 @@ public class GreetingServiceImpl implements GreetingService { } ``` -### Starting service provider +*See [provider/GreetingServiceImpl.java](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samples-api/src/main/java/com/alibaba/dubbo/samples/server/GreetingsServiceImpl.java) on GitHub.* + +### Start service provider ```java package org.apache.dubbo.demo.provider; @@ -71,7 +84,7 @@ import org.apache.dubbo.demo.GreetingService; import java.io.IOException; -public class Provider { +public class Application { public static void main(String[] args) throws IOException { ServiceConfig serviceConfig = new ServiceConfig(); @@ -85,6 +98,15 @@ public class Provider { } ``` +*See [provider/Application.java](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samples-api/src/main/java/com/alibaba/dubbo/samples/provider/Application.java) on GitHub.* + +### Build and run the provider + +```bash +# mvn clean package +# mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.demo.provider.Application exec:java +``` + ### Call remote service in consumer ```java @@ -95,7 +117,7 @@ import com.alibaba.dubbo.config.ReferenceConfig; import com.alibaba.dubbo.config.RegistryConfig; import org.apache.dubbo.demo.GreetingService; -public class Consumer { +public class Application { public static void main(String[] args) { ReferenceConfig referenceConfig = new ReferenceConfig(); referenceConfig.setApplication(new ApplicationConfig("first-dubbo-consumer")); @@ -107,8 +129,20 @@ public class Consumer { } ``` +### Build and run the consumer + +```bash +# mvn clean package +# mvn -Djava.net.preferIPv4Stack=true -Dexec.mainClass=org.apache.dubbo.demo.consumer.Application exec:java +``` + +The consumer will print out `Hello world` on the screen. + +*See [consumer/Application.java](https://github.com/dubbo/dubbo-samples/blob/master/dubbo-samples-api/src/main/java/com/alibaba/dubbo/samples/consumer/Application.java) on GitHub.* + ### 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. * [Dubbo user manual](http://dubbo.apache.org/en-us/docs/user/preface/background.html) - How to use Dubbo and all its features. * [Dubbo developer guide](http://dubbo.apache.org/en-us/docs/dev/build.html) - How to invovle in Dubbo development. * [Dubbo admin manual](http://dubbo.apache.org/en-us/docs/admin/install/provider-demo.html) - How to admin and manage Dubbo services.