[GitHub] coveralls commented on issue #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
coveralls commented on issue #693: [SCB-548] support gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#issuecomment-387664923
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17047620/badge)](https://coveralls.io/builds/17047620)
   
   Coverage increased (+0.2%) to 87.551% when pulling 
**4b5722cfafb0acf0de7863c1d8ab5d58a289ded3 on zhengyangyong:SCB-548** into 
**5c29a7cd224e788cb357e8c640a5f3473ceb0209 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189162929
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -32,31 +35,31 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-ReferenceConfig referenceConfig = 
ReferenceConfigUtils.getForInvoke(microserviceName);
-SchemaMeta schemaMeta = 
referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-Invocation invocation = InvocationFactory.forConsumer(referenceConfig, 
schemaMeta, operationName, args);
-return syncInvoke(invocation);
+validCanInvoke();
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
coveralls commented on issue #709: [SCB-587] Fix archetypes readme
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/709#issuecomment-389490999
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17047179/badge)](https://coveralls.io/builds/17047179)
   
   Coverage increased (+0.005%) to 87.376% when pulling 
**cf50718741f52adf7d94cd65979547c42d81d477 on zhengyangyong:SCB-587** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
coveralls commented on issue #709: [SCB-587] Fix archetypes readme
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/709#issuecomment-389490999
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17047175/badge)](https://coveralls.io/builds/17047175)
   
   Coverage increased (+0.005%) to 87.376% when pulling 
**cf50718741f52adf7d94cd65979547c42d81d477 on zhengyangyong:SCB-587** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong closed pull request #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
zhengyangyong closed pull request #709: [SCB-587] Fix archetypes readme
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/709
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/archetypes/README.md b/archetypes/README.md
index a16ce0377..687a6f4ca 100644
--- a/archetypes/README.md
+++ b/archetypes/README.md
@@ -45,7 +45,8 @@ mvn archetype:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes -Dar
 
 In console Interactive mode, input your GroupId, ArtifactId and Version of new 
project(module), after a while the new project will be generated.
 
-*Notice: We will publish these archetypes to maven center repository since 
1.0.0-m2, if you would like to use an archetype from an unreleased version : *
+*Notice: We will publish these archetypes to maven center repository since 
1.0.0-m2, if you would like to use an archetype from an unreleased version, 
must use `archetypeRepository` option in the version 2.4 of archetype-plugin in 
order to set maven repository to apache snapshot groups: *
+
 ```bash
-mvn archetype:generate -DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=${archetype-version} 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 ```
\ No newline at end of file


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong opened a new pull request #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
zhengyangyong opened a new pull request #709: [SCB-587] Fix archetypes readme
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/709
 
 
   Signed-off-by: zhengyangyong 
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [x] Each commit in the pull request should have a meaningful subject line 
and body.
- [x] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [x] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [x] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   update generate from snapshot repo command


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
WillemJiang commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189155630
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -32,31 +35,31 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-ReferenceConfig referenceConfig = 
ReferenceConfigUtils.getForInvoke(microserviceName);
-SchemaMeta schemaMeta = 
referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-Invocation invocation = InvocationFactory.forConsumer(referenceConfig, 
schemaMeta, operationName, args);
-return syncInvoke(invocation);
+validCanInvoke();
 
 Review comment:
   "validCanInvoke" is a bad name (It just check the status of Engine), how 
about using the "checkEngineStatus".


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #709: [SCB-587] Fix 
archetypes readme
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/709#discussion_r189152140
 
 

 ##
 File path: archetypes/README.md
 ##
 @@ -46,6 +46,7 @@ mvn archetype:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes -Dar
 In console Interactive mode, input your GroupId, ArtifactId and Version of new 
project(module), after a while the new project will be generated.
 
 *Notice: We will publish these archetypes to maven center repository since 
1.0.0-m2, if you would like to use an archetype from an unreleased version : *
+
 ```bash
-mvn archetype:generate -DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=${archetype-version} 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189150551
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189150499
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189150463
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
 
 Review comment:
   Done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报

2018-05-17 Thread GitBox
xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189149707
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/filter/IsolationServerListFilter.java
 ##
 @@ -112,10 +116,18 @@ private boolean allowVisit(Server server) {
   LOGGER.info("The Service {}'s instance {} has been break, will give a 
single test opportunity.",
   microserviceName,
   server);
+  EventManager.post(new IsolationServerEvent(microserviceName, 
totalRequest, currentCountinuousFailureCount,
 
 Review comment:
   done.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #713:  [SCB-591] configcenter 
need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#discussion_r189149432
 
 

 ##
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 ##
 @@ -329,8 +329,14 @@ private void sendHeartbeat(WebSocket ws) {
 
 public void refreshConfig(String configcenter, boolean wait) {
   CountDownLatch latch = new CountDownLatch(1);
+  String encodeServiceName = "";
+  try {
+encodeServiceName = 
URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), "UTF-8");
+  } catch (UnsupportedEncodingException e) {
+LOGGER.error("encode error: {}",e.getMessage());
 
 Review comment:
   1.not format code
   2.failed but still continue?
   3."UTF-8" can changed to java.nio.charset.StandardCharsets.UTF_8.name()


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] yhs0092 commented on issue #714: [SCB-579] fix NullPointerException when consumer upload null file

2018-05-17 Thread GitBox
yhs0092 commented on issue #714: [SCB-579] fix NullPointerException when 
consumer upload null file
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/714#issuecomment-390074524
 
 
   @WillemJiang  This PR deal with the situation that the uploaded file is null 
(Instead of file name).
   Users may write operations that their parameters contains both uploaded 
files and other params like string and int. Sometimes people may call these 
operations but they don't want to upload files.
   So we should ensure that when the uploaded file is null, the microservice 
instances still work well.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报

2018-05-17 Thread GitBox
xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147665
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java
 ##
 @@ -60,29 +63,26 @@ public static void classTeardown() {
 Deencapsulation.setField(ConfigurationManager.class, "instance", null);
 Deencapsulation.setField(ConfigurationManager.class, 
"customConfigurationInstalled", false);
 Deencapsulation.setField(DynamicPropertyFactory.class, "config", null);
+ArchaiusUtils.resetConfig();
 
 Review comment:
   done,removed other reflections.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报

2018-05-17 Thread GitBox
xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147962
 
 

 ##
 File path: 
handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/filter/TestIsolationServerListFilter.java
 ##
 @@ -60,29 +63,26 @@ public static void classTeardown() {
 Deencapsulation.setField(ConfigurationManager.class, "instance", null);
 Deencapsulation.setField(ConfigurationManager.class, 
"customConfigurationInstalled", false);
 Deencapsulation.setField(DynamicPropertyFactory.class, "config", null);
+ArchaiusUtils.resetConfig();
   }
 
   @Before
   public void setUp() throws Exception {
 IsolationServerListFilter = new IsolationServerListFilter();
 loadBalancerStats = new LoadBalancerStats("loadBalancer");
-
-AbstractConfiguration configuration =
-(AbstractConfiguration) 
DynamicPropertyFactory.getBackingConfigurationSource();
-configuration.clearProperty("cse.loadbalance.isolation.enabled");
-configuration.addProperty("cse.loadbalance.isolation.enabled",
+ArchaiusUtils.setProperty("cse.loadbalance.isolation.enabled",
 "true");
-
configuration.clearProperty("cse.loadbalance.isolation.enableRequestThreshold");
-
configuration.addProperty("cse.loadbalance.isolation.enableRequestThreshold",
+
ArchaiusUtils.setProperty("cse.loadbalance.isolation.enableRequestThreshold",
 "3");
 
 taskList = new ArrayList<>();
-EventManager.register(new Object() {
+receiveEvent = new Object() {
   @Subscribe
   public void onEvent(AlarmEvent isolationServerEvent) {
 taskList.add(isolationServerEvent);
   }
-});
+};
+EventManager.register(receiveEvent);
 
 Review comment:
done,save a reference in filter when UT create a new instance for it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报

2018-05-17 Thread GitBox
xuyiyun0929 commented on a change in pull request #678: [SCB-506]服务治理相关的需要事件上报
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/678#discussion_r189147432
 
 

 ##
 File path: 
handlers/handler-bizkeeper/src/main/java/org/apache/servicecomb/bizkeeper/event/CircutBreakerEventNotifier.java
 ##
 @@ -0,0 +1,58 @@
+/*
+ * 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.servicecomb.bizkeeper.event;
+
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.common.event.AlarmEvent.Type;
+
+import com.netflix.hystrix.HystrixCommandKey;
+import com.netflix.hystrix.HystrixEventType;
+import com.netflix.hystrix.strategy.eventnotifier.HystrixEventNotifier;
+
+public class CircutBreakerEventNotifier extends HystrixEventNotifier {
+
+  /**
+   * 使用circuitMarker来记录被熔断的接口
+   */
+  private static ConcurrentHashMap circuitMarker = new 
ConcurrentHashMap<>();
+
+  @Override
+  public void markEvent(HystrixEventType eventType, HystrixCommandKey key) {
+String keyName = key.name();
+switch (eventType) {
+  case SHORT_CIRCUITED:
+if (circuitMarker.get(keyName) == null) {
 
 Review comment:
   Succeeded/failed is not used and has been deleted. Open/close is used to 
indicate circuit and isolation status.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
coveralls commented on issue #693: [SCB-548] support gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#issuecomment-387664923
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17046378/badge)](https://coveralls.io/builds/17046378)
   
   Coverage increased (+0.2%) to 87.551% when pulling 
**8f1bc8ffc574f947c5e26ad639466f7fa60bbcb5 on zhengyangyong:SCB-548** into 
**5c29a7cd224e788cb357e8c640a5f3473ceb0209 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189146562
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,269 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 

[GitHub] coveralls commented on issue #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
coveralls commented on issue #713:  [SCB-591] configcenter need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#issuecomment-389913479
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17046239/badge)](https://coveralls.io/builds/17046239)
   
   Coverage decreased (-0.02%) to 87.347% when pulling 
**b7c8e5bd188da019bd90c84ffb6265db557a6749 on weichao666:configencoding** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zenlinTechnofreak commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zenlinTechnofreak commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189145233
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
+
+相比之下,微服务框架ServiceComb Java 
Chassis支持多种编程模型,每一种编程模型都提供了对应的[Archetypes项目](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/archetypes),包括SpringMVC、JAXRS、POJO和Spring
 Boot Starter,并且未来还会提供**Edge Server**、**Authcation 
Server**等更贴近业务的脚手架项目,让用户能快速构建体系完整的微服务系统。
+
+什么叫一个完整的微服务系统呢?我们可以拿一个具体的场景做例子,会更有感觉:
+
+### 地产CRM
+您经营着一家房地产开发商,销售房产,迫切需要一套销售系统,考虑到微服务的优势,您决定使用微服务的方式构建系统;主要的业务流程也非常简单:用户前来购买购买产品(房产),首先需要登记用户信息,并缴纳一定数量的定金,待交易当日,挑选心仪的产品(房产),支付尾款,完成交易。
+
+微服务的的拆分是一门非常有讲究的学问,即DDD(Domain-Driven Design),不在本文的阐述内,直接上成果:
 
 Review comment:
   Yes, I think maybe we can change the title to '"轻松微服务系列:从一键微服务和DDD设计开始"
   thus we can keep both 2 things together to keep this blog rich and catch 
eyes,  
   1. On-Click microservice 
   2. key DDD relative content in design of CRM


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] weichao666 commented on a change in pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
weichao666 commented on a change in pull request #713:  [SCB-591] configcenter 
need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#discussion_r189142225
 
 

 ##
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 ##
 @@ -329,8 +329,14 @@ private void sendHeartbeat(WebSocket ws) {
 
 public void refreshConfig(String configcenter, boolean wait) {
   CountDownLatch latch = new CountDownLatch(1);
+  String encodeServiceName = "";
+  try {
+encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
+  } catch (UnsupportedEncodingException e1) {
+e1.printStackTrace();
+  }
+  String path = URIConst.ITEMS + "?dimensionsInfo=" + 
StringUtils.deleteWhitespace(encodeServiceName);
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189142184
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,269 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 

[GitHub] weichao666 commented on a change in pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
weichao666 commented on a change in pull request #713:  [SCB-591] configcenter 
need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#discussion_r189142200
 
 

 ##
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 ##
 @@ -329,8 +329,14 @@ private void sendHeartbeat(WebSocket ws) {
 
 public void refreshConfig(String configcenter, boolean wait) {
   CountDownLatch latch = new CountDownLatch(1);
+  String encodeServiceName = "";
+  try {
+encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
+  } catch (UnsupportedEncodingException e1) {
+e1.printStackTrace();
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189141531
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -32,31 +35,31 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-ReferenceConfig referenceConfig = 
ReferenceConfigUtils.getForInvoke(microserviceName);
-SchemaMeta schemaMeta = 
referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-Invocation invocation = InvocationFactory.forConsumer(referenceConfig, 
schemaMeta, operationName, args);
-return syncInvoke(invocation);
+validCanInvoke();
 
 Review comment:
   ok,will changed in future PR


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r189140652
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -32,31 +35,31 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-ReferenceConfig referenceConfig = 
ReferenceConfigUtils.getForInvoke(microserviceName);
-SchemaMeta schemaMeta = 
referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-Invocation invocation = InvocationFactory.forConsumer(referenceConfig, 
schemaMeta, operationName, args);
-return syncInvoke(invocation);
+validCanInvoke();
 
 Review comment:
   Considering the check cost is low, I think it's no problem becasuse these 
method are all public and user may direct use them for general invoke.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-servicecomb-java-chassis] branch master updated: [SCB-531] change demo to test schema without x-java-interface declared.

2018-05-17 Thread wujimin
This is an automated email from the ASF dual-hosted git repository.

wujimin pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
 new da4c3cd  [SCB-531] change demo to test schema without x-java-interface 
declared.
da4c3cd is described below

commit da4c3cd2abc3acc7953ea99a5d1a4d421c07a34b
Author: wujimin 
AuthorDate: Fri May 11 12:43:01 2018 +0800

[SCB-531] change demo to test schema without x-java-interface declared.
---
 demo/demo-schema/src/main/resources/microservices/pojo/server.yaml   | 5 +++--
 .../demo-schema/src/main/resources/microservices/pojo/smartcare.yaml | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml 
b/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
index 543f39f..ac4d37e 100644
--- a/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
+++ b/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
@@ -129,7 +129,8 @@ paths:
 - name: index
   in: query
   required: true
-  type: number
+  type: integer
+  format: int32
 - name: user
   in: body
   schema:
@@ -187,7 +188,7 @@ paths:
 definitions:
   Error:
 type: object
-x-java-class: org.apache.servicecomb.core.exception.CommonExceptionData
+x-java-class: 
org.apache.servicecomb.swagger.invocation.exception.CommonExceptionData
 properties:
   message:
 type: string
diff --git 
a/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml 
b/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
index 49a8ac9..0879c3b 100644
--- a/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
+++ b/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
@@ -21,7 +21,8 @@ swagger: '2.0'
 info:
   title: smartcare test
   version: 1.0.0
-  x-java-interface: org.apache.servicecomb.demo.smartcare.SmartCare
+# x-java-interface is optional, remove it should works well, but sometimes 
need to generate more class in memory
+#  x-java-interface: org.apache.servicecomb.demo.smartcare.SmartCare
 
 # the domain of the service
 #host: api.uber.com

-- 
To stop receiving notification emails like this one, please contact
wuji...@apache.org.


[GitHub] wujimin closed pull request #703: [SCB-531] change demo to test schema without x-java-interface declared.

2018-05-17 Thread GitBox
wujimin closed pull request #703: [SCB-531] change demo to test schema without 
x-java-interface declared.
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/703
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml 
b/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
index 543f39fbf..ac4d37e62 100644
--- a/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
+++ b/demo/demo-schema/src/main/resources/microservices/pojo/server.yaml
@@ -129,7 +129,8 @@ paths:
 - name: index
   in: query
   required: true
-  type: number
+  type: integer
+  format: int32
 - name: user
   in: body
   schema:
@@ -187,7 +188,7 @@ paths:
 definitions:
   Error:
 type: object
-x-java-class: org.apache.servicecomb.core.exception.CommonExceptionData
+x-java-class: 
org.apache.servicecomb.swagger.invocation.exception.CommonExceptionData
 properties:
   message:
 type: string
diff --git 
a/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml 
b/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
index 49a8ac93e..0879c3bda 100644
--- a/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
+++ b/demo/demo-schema/src/main/resources/microservices/pojo/smartcare.yaml
@@ -21,7 +21,8 @@ swagger: '2.0'
 info:
   title: smartcare test
   version: 1.0.0
-  x-java-interface: org.apache.servicecomb.demo.smartcare.SmartCare
+# x-java-interface is optional, remove it should works well, but sometimes 
need to generate more class in memory
+#  x-java-interface: org.apache.servicecomb.demo.smartcare.SmartCare
 
 # the domain of the service
 #host: api.uber.com


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WillemJiang commented on issue #714: [SCB-579] fix NullPointerException when consumer upload null file

2018-05-17 Thread GitBox
WillemJiang commented on issue #714: [SCB-579] fix NullPointerException when 
consumer upload null file
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/714#issuecomment-390052022
 
 
   Not sure if the file name is null is common use case. If it is not, we'd 
better to use Info to tell the system operator there is something is abnormal. 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #709: [SCB-587] Fix archetypes readme

2018-05-17 Thread GitBox
WillemJiang commented on a change in pull request #709: [SCB-587] Fix 
archetypes readme
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/709#discussion_r189133984
 
 

 ##
 File path: archetypes/README.md
 ##
 @@ -46,6 +46,7 @@ mvn archetype:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes -Dar
 In console Interactive mode, input your GroupId, ArtifactId and Version of new 
project(module), after a while the new project will be generated.
 
 *Notice: We will publish these archetypes to maven center repository since 
1.0.0-m2, if you would like to use an archetype from an unreleased version : *
+
 ```bash
-mvn archetype:generate -DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=${archetype-version} 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 
 Review comment:
   In the release version we do need to specify the archetypeRepository. 
   I think it's better explain -DarchetypeXXX options to avoid making user 
confused.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-servicecomb-java-chassis] branch master updated: SCB-588 add archetypes sourceEncoding UTF-8

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git


The following commit(s) were added to refs/heads/master by this push:
 new df66108  SCB-588 add archetypes sourceEncoding UTF-8
df66108 is described below

commit df66108e162e240c7ab71ca1d9f2ffd1792d5cb3
Author: zhengyangyong 
AuthorDate: Thu May 17 11:02:35 2018 +0800

SCB-588 add archetypes sourceEncoding UTF-8

Signed-off-by: zhengyangyong 
---
 .../src/main/resources/archetype-resources/pom.xml   | 1 +
 .../business-service-pojo/src/main/resources/archetype-resources/pom.xml | 1 +
 .../src/main/resources/archetype-resources/pom.xml   | 1 +
 .../src/main/resources/archetype-resources/pom.xml   | 1 +
 4 files changed, 4 insertions(+)

diff --git 
a/archetypes/business-service-jaxrs/src/main/resources/archetype-resources/pom.xml
 
b/archetypes/business-service-jaxrs/src/main/resources/archetype-resources/pom.xml
index 2ad5a5e..eb7f27f 100644
--- 
a/archetypes/business-service-jaxrs/src/main/resources/archetype-resources/pom.xml
+++ 
b/archetypes/business-service-jaxrs/src/main/resources/archetype-resources/pom.xml
@@ -25,6 +25,7 @@
   4.0.0
 
   
+UTF-8
 1.0.0-m2-SNAPSHOT
   
 
diff --git 
a/archetypes/business-service-pojo/src/main/resources/archetype-resources/pom.xml
 
b/archetypes/business-service-pojo/src/main/resources/archetype-resources/pom.xml
index a1bcdab..d5d0494 100644
--- 
a/archetypes/business-service-pojo/src/main/resources/archetype-resources/pom.xml
+++ 
b/archetypes/business-service-pojo/src/main/resources/archetype-resources/pom.xml
@@ -25,6 +25,7 @@
   4.0.0
 
   
+UTF-8
 1.0.0-m2-SNAPSHOT
   
 
diff --git 
a/archetypes/business-service-spring-boot-starter/src/main/resources/archetype-resources/pom.xml
 
b/archetypes/business-service-spring-boot-starter/src/main/resources/archetype-resources/pom.xml
index 7d5282a..8d9e016 100644
--- 
a/archetypes/business-service-spring-boot-starter/src/main/resources/archetype-resources/pom.xml
+++ 
b/archetypes/business-service-spring-boot-starter/src/main/resources/archetype-resources/pom.xml
@@ -25,6 +25,7 @@
   4.0.0
 
   
+UTF-8
 1.0.0-m2-SNAPSHOT
 1.4.5.RELEASE
   
diff --git 
a/archetypes/business-service-springmvc/src/main/resources/archetype-resources/pom.xml
 
b/archetypes/business-service-springmvc/src/main/resources/archetype-resources/pom.xml
index f3757b7..187d5f3 100644
--- 
a/archetypes/business-service-springmvc/src/main/resources/archetype-resources/pom.xml
+++ 
b/archetypes/business-service-springmvc/src/main/resources/archetype-resources/pom.xml
@@ -25,6 +25,7 @@
   4.0.0
 
   
+UTF-8
 1.0.0-m2-SNAPSHOT
   
 

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[GitHub] WillemJiang commented on a change in pull request #704: [SCB-582]Provide a way to protect instance removal

2018-05-17 Thread GitBox
WillemJiang commented on a change in pull request #704: [SCB-582]Provide a way 
to protect instance removal
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/704#discussion_r189132762
 
 

 ##
 File path: demo/demo-pojo/pojo-client/src/main/resources/microservice.yaml
 ##
 @@ -23,6 +23,12 @@ servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
+  instance:
+healthCheck:
+  interval: 2
+watch: false
+empty:
 
 Review comment:
   Please update document if there is new option introduced. 
   Is there any other empty related options? 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WillemJiang commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
WillemJiang commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r189130534
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
+
+相比之下,微服务框架ServiceComb Java 
Chassis支持多种编程模型,每一种编程模型都提供了对应的[Archetypes项目](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/archetypes),包括SpringMVC、JAXRS、POJO和Spring
 Boot Starter,并且未来还会提供**Edge Server**、**Authcation 
Server**等更贴近业务的脚手架项目,让用户能快速构建体系完整的微服务系统。
+
+什么叫一个完整的微服务系统呢?我们可以拿一个具体的场景做例子,会更有感觉:
+
+### 地产CRM
+您经营着一家房地产开发商,销售房产,迫切需要一套销售系统,考虑到微服务的优势,您决定使用微服务的方式构建系统;主要的业务流程也非常简单:用户前来购买购买产品(房产),首先需要登记用户信息,并缴纳一定数量的定金,待交易当日,挑选心仪的产品(房产),支付尾款,完成交易。
+
+微服务的的拆分是一门非常有讲究的学问,即DDD(Domain-Driven Design),不在本文的阐述内,直接上成果:
 
 Review comment:
   DDD与微服务拆分相关的内容是划分界限上下文,可以给出相关的参考帮助大家快速了解核心。


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #714: [SCB-579] fix NullPointerException when consumer upload null file

2018-05-17 Thread GitBox
coveralls commented on issue #714: [SCB-579] fix NullPointerException when 
consumer upload null file
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/714#issuecomment-389939918
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17037680/badge)](https://coveralls.io/builds/17037680)
   
   Coverage decreased (-0.03%) to 87.345% when pulling 
**a93e627a8e56af655508e8503a0b1f87bb52d3df on 
yhs0092:NullPointerException_is_thrown_when_null_file_is_uploaded** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] yhs0092 opened a new pull request #714: [SCB-579] fix NullPointerException when consumer upload null file

2018-05-17 Thread GitBox
yhs0092 opened a new pull request #714: [SCB-579] fix NullPointerException when 
consumer upload null file
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/714
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   See details in [SCB-579](https://issues.apache.org/jira/browse/SCB-579)


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
coveralls commented on issue #713:  [SCB-591] configcenter need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#issuecomment-389913479
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17035942/badge)](https://coveralls.io/builds/17035942)
   
   Coverage decreased (-0.03%) to 87.341% when pulling 
**80021490e0d50da40dff26702275cf1a4c964e63 on weichao666:configencoding** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] foshantiger commented on issue #329: 建议新增mac版的release

2018-05-17 Thread GitBox
foshantiger commented on issue #329: 建议新增mac版的release
URL: 
https://github.com/apache/incubator-servicecomb-service-center/issues/329#issuecomment-389907436
 
 
   同求mac版


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188972063
 
 

 ##
 File path: 
core/src/main/java/org/apache/servicecomb/core/provider/consumer/InvokerUtils.java
 ##
 @@ -32,31 +35,31 @@
   private static final Logger LOGGER = 
LoggerFactory.getLogger(InvokerUtils.class);
 
   public static Object syncInvoke(String microserviceName, String schemaId, 
String operationName, Object[] args) {
-ReferenceConfig referenceConfig = 
ReferenceConfigUtils.getForInvoke(microserviceName);
-SchemaMeta schemaMeta = 
referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
-Invocation invocation = InvocationFactory.forConsumer(referenceConfig, 
schemaMeta, operationName, args);
-return syncInvoke(invocation);
+validCanInvoke();
 
 Review comment:
   please check validCanInvoke()
   this invoked multi times for one invocation


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188971043
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,269 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 
listener.getClass().getName(), 

[GitHub] wujimin commented on a change in pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #713:  [SCB-591] configcenter 
need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#discussion_r188969749
 
 

 ##
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 ##
 @@ -329,8 +329,14 @@ private void sendHeartbeat(WebSocket ws) {
 
 public void refreshConfig(String configcenter, boolean wait) {
   CountDownLatch latch = new CountDownLatch(1);
+  String encodeServiceName = "";
+  try {
+encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
+  } catch (UnsupportedEncodingException e1) {
+e1.printStackTrace();
+  }
+  String path = URIConst.ITEMS + "?dimensionsInfo=" + 
StringUtils.deleteWhitespace(encodeServiceName);
 
 Review comment:
   delete whitespace before or after encode?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #713:  [SCB-591] configcenter 
need to do encode
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/713#discussion_r188969579
 
 

 ##
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
 ##
 @@ -329,8 +329,14 @@ private void sendHeartbeat(WebSocket ws) {
 
 public void refreshConfig(String configcenter, boolean wait) {
   CountDownLatch latch = new CountDownLatch(1);
+  String encodeServiceName = "";
+  try {
+encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
+  } catch (UnsupportedEncodingException e1) {
+e1.printStackTrace();
 
 Review comment:
   print?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #712: [SCB-590] Update the validator version

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #712: [SCB-590] Update the 
validator version
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/712#discussion_r188968905
 
 

 ##
 File path: java-chassis-dependencies/pom.xml
 ##
 @@ -324,7 +324,7 @@
   
 org.hibernate
 hibernate-validator-annotation-processor
-5.2.2.Final
+6.0.2.Final
 
 Review comment:
   license file need to be updated too.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] weichao666 opened a new pull request #713: [SCB-591] configcenter need to do encode

2018-05-17 Thread GitBox
weichao666 opened a new pull request #713:  [SCB-591] configcenter need to do 
encode
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/713
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   huawei's huangyun set up an agent to modify the special characters '#',which 
led to the governance inoperative


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zenlinTechnofreak commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zenlinTechnofreak commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r188898701
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
 
 Review comment:
   How about change the title to obviously pointed out that one-click build 
micro service


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zenlinTechnofreak commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zenlinTechnofreak commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r188902926
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
+
+相比之下,微服务框架ServiceComb Java 
Chassis支持多种编程模型,每一种编程模型都提供了对应的[Archetypes项目](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/archetypes),包括SpringMVC、JAXRS、POJO和Spring
 Boot Starter,并且未来还会提供**Edge Server**、**Authcation 
Server**等更贴近业务的脚手架项目,让用户能快速构建体系完整的微服务系统。
+
+什么叫一个完整的微服务系统呢?我们可以拿一个具体的场景做例子,会更有感觉:
+
+### 地产CRM
+您经营着一家房地产开发商,销售房产,迫切需要一套销售系统,考虑到微服务的优势,您决定使用微服务的方式构建系统;主要的业务流程也非常简单:用户前来购买购买产品(房产),首先需要登记用户信息,并缴纳一定数量的定金,待交易当日,挑选心仪的产品(房产),支付尾款,完成交易。
+
+微服务的的拆分是一门非常有讲究的学问,即DDD(Domain-Driven Design),不在本文的阐述内,直接上成果:
 
 Review comment:
   I think DDD it is quite welcomed in microservice field, suggest you 
describing it briefly, it could make concern to the readers and lovers.
   
   Anyway, you can read how to express it referenced to 
http://cywhoyi.iteye.com/blog/2312446.
   
   For example, Maybe you can use a picture like 
http://dl2.iteye.com/upload/attachment/0118/8172/2ff5c2d9-8ebb-32eb-b431-ba40f4fbe76b.png
 here and briefly describe the main logic about using DDD in design CRM system.
   
   
   Anyway, if we done this ,we can make the blog more pleasing to the reader 
and richer in content.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zenlinTechnofreak commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zenlinTechnofreak commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r188901530
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
+
+相比之下,微服务框架ServiceComb Java 
Chassis支持多种编程模型,每一种编程模型都提供了对应的[Archetypes项目](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/archetypes),包括SpringMVC、JAXRS、POJO和Spring
 Boot Starter,并且未来还会提供**Edge Server**、**Authcation 
Server**等更贴近业务的脚手架项目,让用户能快速构建体系完整的微服务系统。
 
 Review comment:
   You can describe the advantage you want to pass to users at line 57, Maybe 
something like,
   "ServiceComb  Java Chassis 的脚手架具备更明显的有点,每一种"


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zenlinTechnofreak commented on a change in pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zenlinTechnofreak commented on a change in pull request #85: add 
easy-build-microservice-system-part-I blog
URL: 
https://github.com/apache/incubator-servicecomb-website/pull/85#discussion_r188900660
 
 

 ##
 File path: _posts/cn/2018-05-17-easy-build-microservice-system-part-I.md
 ##
 @@ -0,0 +1,91 @@
+---
+title: "轻松微服务系列:使用脚手架功能一键构建微服务"
+lang: cn
+ref: easy-build-microservice-system-part-I
+permalink: /cn/docs/easy-build-microservice-system-part-I/
+excerpt: "轻松微服务系列:使用脚手架功能一键构建微服务"
+last_modified_at: 2018-05-17T19:05:00+08:00
+author: Yangyong Zheng
+tags: [Archetypes, Scaffold]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:使用脚手架功能一键构建微服务
+提到微服务,相信“程序猿”们已经不再陌生,估计大家都多少尝试过微服务框架,也遇到了不少“坑”直呼坑爹吧?实际上微服务的初衷正是为了“解放”开发者,使得系统构建的过程更加轻松愉快,所以我们开了这个“轻松微服务系列”,和大家一起愉快的走一遭!废话不多说,上菜:
+
+### 牛刀小试
+打开命令行,输入下面的命令:
+```bash
+mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate 
-DarchetypeGroupId=org.apache.servicecomb.archetypes 
-DarchetypeArtifactId=business-service-jaxrs-archetype 
-DarchetypeVersion=1.0.0-m2-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
+```
+
+>提示:由于ServiceComb Archetypes还处于SNAPSHOT阶段,Repository托管在Apache 
Snapshots库中,所以下载速度会稍慢。
+
+之后按提示指定微服务的`groupId`,`artifactId`,`version`,`package`等信息,回车,一个新的微服务就创建好了:
+
+![Archetypes创建](/assets/images/scaffold/ArchetypesCreate.png)
+
+运行它也很简单,使用IDE打开项目,DEBUG -> Application.java,或在命令行:
+
+```bash
+#编译打包
+mvn package
+#切换到输出目录
+cd target
+#启动可执行jar包
+java -jar .jar
+```
+
+稍等微服务就启动好了,打开浏览器输入`http://localhost:8080/hello`验证一下:
+
+![输出hello](/assets/images/scaffold/OutputHello.png)
+
+是不是非常轻松呢?这份轻松来源我们使用Archetypes优化了构建过程,它是脚手架的基础。
+
+### 脚手架
+在建筑领域,脚手架是施工现场为方便工人操作并解决垂直和水平运输而搭设的各种支架以及平台。
+
+![scaffold](/assets/images/scaffold/Scaffold.jpg)
+
+在软件开发领域,它引申为预提供一些基础框架代码加速开发过程,避免从零开始构建项目。用户只需要依据需求场景选择合适的脚手架,然后填充定制的业务逻辑即可,不必再去处理一些基础功能,例如数据库连接、日志实现、RPC传输等。
+
+微服务框架一般都会提供脚手架功能,例如Spring,提供了Spring initializr:
+
+![SpringInitializr](/assets/images/scaffold/SpringInitializr.png)
+
+它集成了Spring Boot和Spring Cloud丰富的组件,不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**。
 
 Review comment:
   To my opinion, you could only explain what is architype, but not to point 
out others's shortcoming.
   How about to delete this part,
   "不过比较遗憾的是它基本没有提供代码级别的示例,更像是一个**“POM组合器”**"


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong opened a new pull request #85: add easy-build-microservice-system-part-I blog

2018-05-17 Thread GitBox
zhengyangyong opened a new pull request #85: add 
easy-build-microservice-system-part-I blog
URL: https://github.com/apache/incubator-servicecomb-website/pull/85
 
 
   Signed-off-by: zhengyangyong 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-servicecomb-website] 01/02: Merge branch 'master' into asf-site

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch asf-site
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git

commit b56299c2fd7c5aa40d813deeb6b983d1e8678e3f
Merge: 741a215 f9aea01
Author: Willem Jiang 
AuthorDate: Thu May 17 17:01:56 2018 +0800

Merge branch 'master' into asf-site

 _docs/cn/distributed-tracing.md|  2 +-
 _docs/cn/flow-control.md   |  2 +-
 _docs/cn/quick-start-bmi.md|  4 +-
 _docs/cn/quick-start-dataconsistency.md|  2 +-
 _docs/cn/service-management.md |  2 +-
 _docs/distributed-tracing.md   |  2 +-
 _docs/flow-control.md  |  2 +-
 _docs/quick-start-bmi.md   |  4 +-
 _docs/quick-start-dataconsistency.md   |  2 +-
 _docs/service-management.md|  2 +-
 _faqs/cn/faq.md|  2 +-
 _faqs/cn/huawei-cloud-faq.md   |  4 +-
 _faqs/huawei-cloud-faq.md  |  6 +-
 _posts/2017-06-15-linuxcon-workshop-demo.md| 10 ++--
 _posts/2017-07-17-tracing-with-servicecomb.md  |  2 +-
 _posts/2017-08-21-company-on-kubernetes.md |  2 +-
 _posts/cn/2017-06-15-linuxcon-workshop-demo.md | 10 ++--
 _posts/cn/2017-07-17-tracing-with-servicecomb.md   |  2 +-
 .../cn/2017-09-14-maven-dependency-management.md   |  7 ---
 _users/cn/communicate-protocol.md  | 46 +++---
 _users/cn/distributed-tracing.md   |  3 +-
 _users/cn/invoke-control.md| 14 ++---
 _users/cn/local-develop-test.md|  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/cn/metrics-in-0.5.0.md  |  2 +-
 _users/cn/metrics-in-1.0.0-m1.md   |  4 +-
 _users/cn/service-configurations.md| 66 ++--
 _users/cn/setup-environment.md |  2 +-
 _users/cn/use-service-contract.md  |  2 +-
 _users/cn/use-tls.md   |  6 +-
 _users/cn/zuul.md  |  4 +-
 _users/communicate-protocol.md | 46 +++---
 _users/distributed-tracing.md  |  3 +-
 _users/huawei-cloud-faq.md |  6 +-
 _users/invoke-control.md   | 14 ++---
 _users/local-develop-test.md   |  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/metrics-in-1.0.0-m1.md  |  2 +-
 _users/service-configurations.md   | 70 +++---
 _users/setup-environment.md|  2 +-
 _users/use-service-contract.md |  2 +-
 _users/use-tls.md  |  6 +-
 _users/zuul.md |  4 +-
 43 files changed, 187 insertions(+), 194 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[incubator-servicecomb-website] 02/02: Publish the website

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch asf-site
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git

commit 8566a0f1675aa5fec91aa0288ab6566aab64f202
Author: Willem Jiang 
AuthorDate: Thu May 17 17:02:46 2018 +0800

Publish the website
---
 content/cn/docs/linuxcon-workshop-demo/index.html  | 10 +--
 .../cn/docs/maven_dependency_management/index.html |  7 --
 .../distributed-tracing/index.html |  2 +-
 .../quick-start-advance/flow-control/index.html|  2 +-
 .../service-management/index.html  |  2 +-
 content/cn/docs/quick-start-bmi/index.html |  4 +-
 .../cn/docs/quick-start-dataconsistency/index.html |  2 +-
 .../cn/docs/tracing-with-servicecomb/index.html|  2 +-
 content/cn/faqs/faqs-huawei-cloud/index.html   |  4 +-
 content/cn/faqs/index.html |  2 +-
 content/cn/users/communicate-protocol/index.html   | 46 +++---
 content/cn/users/distributed-tracing/index.html|  3 +-
 content/cn/users/edging-service/zuul/index.html|  4 +-
 content/cn/users/invoke-control/index.html | 14 ++--
 content/cn/users/local-develop-test/index.html |  2 +-
 .../index.html |  2 +-
 content/cn/users/metrics-in-0.5.0/index.html   |  2 +-
 content/cn/users/metrics-in-1.0.0-m1/index.html|  4 +-
 content/cn/users/service-configurations/index.html | 70 ++--
 content/cn/users/setup-environment/index.html  |  2 +-
 content/cn/users/use-service-contract/index.html   |  2 +-
 content/cn/users/use-tls/index.html|  6 +-
 content/docs/company-on-kubernetes/index.html  |  2 +-
 content/docs/linuxcon-workshop-demo/index.html | 10 +--
 .../distributed-tracing/index.html |  2 +-
 .../quick-start-advance/flow-control/index.html|  2 +-
 .../service-management/index.html  |  2 +-
 content/docs/quick-start-bmi/index.html|  4 +-
 .../docs/quick-start-dataconsistency/index.html|  2 +-
 content/docs/tracing-with-servicecomb/index.html   |  2 +-
 content/faqs/faqs-huawei-cloud/index.html  |  6 +-
 content/feed.xml   |  2 +-
 content/users/communicate-protocol/index.html  | 46 +++---
 content/users/distributed-tracing/index.html   |  3 +-
 content/users/edging-service/zuul/index.html   |  4 +-
 content/users/huawei-cloud-faq/index.html  |  6 +-
 content/users/invoke-control/index.html| 14 ++--
 content/users/local-develop-test/index.html|  2 +-
 .../index.html |  2 +-
 content/users/metrics-in-1.0.0-m1/index.html   |  2 +-
 content/users/service-configurations/index.html| 74 +++---
 content/users/setup-environment/index.html |  2 +-
 content/users/use-service-contract/index.html  |  2 +-
 content/users/use-tls/index.html   |  6 +-
 44 files changed, 192 insertions(+), 199 deletions(-)

diff --git a/content/cn/docs/linuxcon-workshop-demo/index.html 
b/content/cn/docs/linuxcon-workshop-demo/index.html
index cf73cae..0f51e02 100644
--- a/content/cn/docs/linuxcon-workshop-demo/index.html
+++ b/content/cn/docs/linuxcon-workshop-demo/index.html
@@ -574,7 +574,7 @@
   name: worker
   version: 0.0.1
 # service center address
-cse:
+servicecomb:
   service:
 registry:
   address: http://sc.servicecomb.io:30100
@@ -742,7 +742,7 @@ Credit: http://www.dave-cushman.net;>Dave 
Cushman’s website
 # name of the declaring microservice
   name: beekeeper
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://sc.servicecomb.io:30100
@@ -759,7 +759,7 @@ Credit: http://www.dave-cushman.net;>Dave 
Cushman’s website
 
 
 
-这里我们需要定义 cse.references.worker.version-rule 
,让配置名称中指向技工服务名 worker 
,并匹配其版本号。
+这里我们需要定义 servicecomb.references.worker.version-rule 
,让配置名称中指向技工服务名 worker 
,并匹配其版本号。
 
 最后定义养蜂人服务应用入口:
 
@@ -879,7 +879,7 @@ Credit: http://www.dave-cushman.net;>Dave 
Cushman’s website
 # name of the declaring microservice
   name: doorman
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://sc.servicecomb.io:30100
@@ -1108,7 +1108,7 @@ Credit: http://www.dave-cushman.net;>Dave 
Cushman’s website
 service_description:
   name: manager
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://sc.servicecomb.io:30100
diff --git a/content/cn/docs/maven_dependency_management/index.html 
b/content/cn/docs/maven_dependency_management/index.html
index 993096e..408201e 100644
--- a/content/cn/docs/maven_dependency_management/index.html
+++ b/content/cn/docs/maven_dependency_management/index.html
@@ -491,13 +491,6 @@
typepom/type
scopeimport/scope
  /dependency
- 

[incubator-servicecomb-website] branch asf-site updated (741a215 -> 8566a0f)

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch asf-site
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git.


from 741a215  Publish the website
 add e552a5c  [SCB-560]Adding guide of how to use gitter (#83)
 add f9aea01  replace 'cse' to 'servicecomb' (#84)
 new b56299c  Merge branch 'master' into asf-site
 new 8566a0f  Publish the website

The 2 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:
 _docs/cn/distributed-tracing.md|  2 +-
 _docs/cn/flow-control.md   |  2 +-
 _docs/cn/quick-start-bmi.md|  4 +-
 _docs/cn/quick-start-dataconsistency.md|  2 +-
 _docs/cn/service-management.md |  2 +-
 _docs/distributed-tracing.md   |  2 +-
 _docs/flow-control.md  |  2 +-
 _docs/quick-start-bmi.md   |  4 +-
 _docs/quick-start-dataconsistency.md   |  2 +-
 _docs/service-management.md|  2 +-
 _faqs/cn/faq.md|  2 +-
 _faqs/cn/huawei-cloud-faq.md   |  4 +-
 _faqs/huawei-cloud-faq.md  |  6 +-
 _posts/2017-06-15-linuxcon-workshop-demo.md| 10 +--
 _posts/2017-07-17-tracing-with-servicecomb.md  |  2 +-
 _posts/2017-08-21-company-on-kubernetes.md |  2 +-
 _posts/cn/2017-06-15-linuxcon-workshop-demo.md | 10 +--
 _posts/cn/2017-07-17-tracing-with-servicecomb.md   |  2 +-
 .../cn/2017-09-14-maven-dependency-management.md   |  7 --
 _users/cn/communicate-protocol.md  | 46 +++---
 _users/cn/distributed-tracing.md   |  3 +-
 _users/cn/invoke-control.md| 14 ++--
 _users/cn/local-develop-test.md|  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/cn/metrics-in-0.5.0.md  |  2 +-
 _users/cn/metrics-in-1.0.0-m1.md   |  4 +-
 _users/cn/service-configurations.md| 66 +--
 _users/cn/setup-environment.md |  2 +-
 _users/cn/use-service-contract.md  |  2 +-
 _users/cn/use-tls.md   |  6 +-
 _users/cn/zuul.md  |  4 +-
 _users/communicate-protocol.md | 46 +++---
 _users/distributed-tracing.md  |  3 +-
 _users/huawei-cloud-faq.md |  6 +-
 _users/invoke-control.md   | 14 ++--
 _users/local-develop-test.md   |  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/metrics-in-1.0.0-m1.md  |  2 +-
 _users/service-configurations.md   | 70 ++--
 _users/setup-environment.md|  2 +-
 _users/use-service-contract.md |  2 +-
 _users/use-tls.md  |  6 +-
 _users/zuul.md |  4 +-
 content/cn/docs/linuxcon-workshop-demo/index.html  | 10 +--
 .../cn/docs/maven_dependency_management/index.html |  7 --
 .../distributed-tracing/index.html |  2 +-
 .../quick-start-advance/flow-control/index.html|  2 +-
 .../service-management/index.html  |  2 +-
 content/cn/docs/quick-start-bmi/index.html |  4 +-
 .../cn/docs/quick-start-dataconsistency/index.html |  2 +-
 .../cn/docs/tracing-with-servicecomb/index.html|  2 +-
 content/cn/faqs/faqs-huawei-cloud/index.html   |  4 +-
 content/cn/faqs/index.html |  2 +-
 content/cn/users/communicate-protocol/index.html   | 46 +++---
 content/cn/users/distributed-tracing/index.html|  3 +-
 content/cn/users/edging-service/zuul/index.html|  4 +-
 content/cn/users/invoke-control/index.html | 14 ++--
 content/cn/users/local-develop-test/index.html |  2 +-
 .../index.html |  2 +-
 content/cn/users/metrics-in-0.5.0/index.html   |  2 +-
 content/cn/users/metrics-in-1.0.0-m1/index.html|  4 +-
 content/cn/users/service-configurations/index.html | 70 ++--
 content/cn/users/setup-environment/index.html  |  2 +-
 content/cn/users/use-service-contract/index.html   |  2 +-
 content/cn/users/use-tls/index.html|  6 +-
 content/docs/company-on-kubernetes/index.html  |  2 +-
 content/docs/linuxcon-workshop-demo/index.html | 10 +--
 .../distributed-tracing/index.html |  2 +-
 .../quick-start-advance/flow-control/index.html|  2 +-
 .../service-management/index.html  

[GitHub] WillemJiang closed pull request #84: replace 'cse' to 'servicecomb'

2018-05-17 Thread GitBox
WillemJiang closed pull request #84: replace 'cse' to 'servicecomb'
URL: https://github.com/apache/incubator-servicecomb-website/pull/84
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/_docs/cn/distributed-tracing.md b/_docs/cn/distributed-tracing.md
index 3ecec28..20281b9 100644
--- a/_docs/cn/distributed-tracing.md
+++ b/_docs/cn/distributed-tracing.md
@@ -28,7 +28,7 @@ last_modified_at: 2017-09-03T10:01:43-04:00
 2. 在 *体质指数计算器* 的 `microservice.yaml` 文件中添加分布式追踪的处理链:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/cn/flow-control.md b/_docs/cn/flow-control.md
index d607b6a..d19c60c 100644
--- a/_docs/cn/flow-control.md
+++ b/_docs/cn/flow-control.md
@@ -28,7 +28,7 @@ last_modified_at: 2017-09-03T10:01:43-04:00
 2. 在 *体质指数计算器* 的 `microservice.yaml` 文件中指明使用流量控制的处理链及指定流控策略:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/cn/quick-start-bmi.md b/_docs/cn/quick-start-bmi.md
index 594e192..1882ee5 100644
--- a/_docs/cn/quick-start-bmi.md
+++ b/_docs/cn/quick-start-bmi.md
@@ -116,7 +116,7 @@ APPLICATION_ID: bmi
 service_description:
   name: calculator
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
@@ -189,7 +189,7 @@ APPLICATION_ID: bmi
 service_description:
   name: gateway
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
diff --git a/_docs/cn/quick-start-dataconsistency.md 
b/_docs/cn/quick-start-dataconsistency.md
index d333859..c378ec6 100644
--- a/_docs/cn/quick-start-dataconsistency.md
+++ b/_docs/cn/quick-start-dataconsistency.md
@@ -41,7 +41,7 @@ last_modified_at: 2017-09-19T11:50:10-04:00
service_description:
  name: flight-booking-service
  version: 0.0.1
-   cse:
+   servicecomb:
  service:
registry:
  address: http://sc.servicecomb.io:30100 
#此处选择使用ServiceComb的Service Center
diff --git a/_docs/cn/service-management.md b/_docs/cn/service-management.md
index 236e94e..10abc17 100644
--- a/_docs/cn/service-management.md
+++ b/_docs/cn/service-management.md
@@ -28,7 +28,7 @@ last_modified_at: 2017-09-03T10:01:43-04:00
 2. 在 *体质指数计算器* 的 `microservice.yaml` 文件中指明使用服务治理的处理链及指定熔断和容错策略:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/distributed-tracing.md b/_docs/distributed-tracing.md
index 92d7b98..e11d2d7 100644
--- a/_docs/distributed-tracing.md
+++ b/_docs/distributed-tracing.md
@@ -28,7 +28,7 @@ Walk through [Develop microservice application in 
minutes](/docs/quick-start-bmi
 2. Add handler chain of distributed tracing in `microservice.yaml` of *BMI 
calculator service*:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/flow-control.md b/_docs/flow-control.md
index 155537f..eeef9ce 100644
--- a/_docs/flow-control.md
+++ b/_docs/flow-control.md
@@ -28,7 +28,7 @@ Walk through [Develop microservice application in 
minutes](/docs/quick-start-bmi
 2. Add handler chain and configurations of flow control in `microservice.yaml` 
of *BMI calculator service*:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/quick-start-bmi.md b/_docs/quick-start-bmi.md
index fe62f12..37695d3 100644
--- a/_docs/quick-start-bmi.md
+++ b/_docs/quick-start-bmi.md
@@ -116,7 +116,7 @@ APPLICATION_ID: bmi
 service_description:
   name: calculator
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
@@ -189,7 +189,7 @@ APPLICATION_ID: bmi
 service_description:
   name: gateway
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
diff --git a/_docs/quick-start-dataconsistency.md 
b/_docs/quick-start-dataconsistency.md
index adc6397..76b0fe9 100644
--- a/_docs/quick-start-dataconsistency.md
+++ b/_docs/quick-start-dataconsistency.md
@@ -40,7 +40,7 @@ Note, demo is in the 
[ServiceComb-Saga](https://github.com/apache/incubator-serv
service_description:
  name: flight-booking-service
  version: 0.0.1
-   cse:
+   servicecomb:
  service:
registry:
  address: http://sc.servicecomb.io:30100 #choose Service Center 
provided by ServiceComb
diff --git a/_docs/service-management.md b/_docs/service-management.md
index 3462ce9..8e237ec 100644
--- a/_docs/service-management.md
+++ b/_docs/service-management.md
@@ -28,7 +28,7 @@ Walk through [Develop microservice application in 
minutes](/docs/quick-start-bmi
 2. Configure handler chain of service management and fallback strategy:

[incubator-servicecomb-website] branch master updated: replace 'cse' to 'servicecomb' (#84)

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-website.git


The following commit(s) were added to refs/heads/master by this push:
 new f9aea01  replace 'cse' to 'servicecomb' (#84)
f9aea01 is described below

commit f9aea01229664f524b6ad033b4948e320ce65d77
Author: zhengyangyong 
AuthorDate: Thu May 17 17:01:02 2018 +0800

replace 'cse' to 'servicecomb' (#84)

Signed-off-by: zhengyangyong 
---
 _docs/cn/distributed-tracing.md|  2 +-
 _docs/cn/flow-control.md   |  2 +-
 _docs/cn/quick-start-bmi.md|  4 +-
 _docs/cn/quick-start-dataconsistency.md|  2 +-
 _docs/cn/service-management.md |  2 +-
 _docs/distributed-tracing.md   |  2 +-
 _docs/flow-control.md  |  2 +-
 _docs/quick-start-bmi.md   |  4 +-
 _docs/quick-start-dataconsistency.md   |  2 +-
 _docs/service-management.md|  2 +-
 _faqs/cn/faq.md|  2 +-
 _faqs/cn/huawei-cloud-faq.md   |  4 +-
 _faqs/huawei-cloud-faq.md  |  6 +-
 _posts/2017-06-15-linuxcon-workshop-demo.md| 10 ++--
 _posts/2017-07-17-tracing-with-servicecomb.md  |  2 +-
 _posts/2017-08-21-company-on-kubernetes.md |  2 +-
 _posts/cn/2017-06-15-linuxcon-workshop-demo.md | 10 ++--
 _posts/cn/2017-07-17-tracing-with-servicecomb.md   |  2 +-
 .../cn/2017-09-14-maven-dependency-management.md   |  7 ---
 _users/cn/communicate-protocol.md  | 46 +++---
 _users/cn/distributed-tracing.md   |  3 +-
 _users/cn/invoke-control.md| 14 ++---
 _users/cn/local-develop-test.md|  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/cn/metrics-in-0.5.0.md  |  2 +-
 _users/cn/metrics-in-1.0.0-m1.md   |  4 +-
 _users/cn/service-configurations.md| 66 ++--
 _users/cn/setup-environment.md |  2 +-
 _users/cn/use-service-contract.md  |  2 +-
 _users/cn/use-tls.md   |  6 +-
 _users/cn/zuul.md  |  4 +-
 _users/communicate-protocol.md | 46 +++---
 _users/distributed-tracing.md  |  3 +-
 _users/huawei-cloud-faq.md |  6 +-
 _users/invoke-control.md   | 14 ++---
 _users/local-develop-test.md   |  2 +-
 ...nage_springcloud_application_using_sc_and_gs.md |  2 +-
 _users/metrics-in-1.0.0-m1.md  |  2 +-
 _users/service-configurations.md   | 70 +++---
 _users/setup-environment.md|  2 +-
 _users/use-service-contract.md |  2 +-
 _users/use-tls.md  |  6 +-
 _users/zuul.md |  4 +-
 43 files changed, 187 insertions(+), 194 deletions(-)

diff --git a/_docs/cn/distributed-tracing.md b/_docs/cn/distributed-tracing.md
index 3ecec28..20281b9 100644
--- a/_docs/cn/distributed-tracing.md
+++ b/_docs/cn/distributed-tracing.md
@@ -28,7 +28,7 @@ last_modified_at: 2017-09-03T10:01:43-04:00
 2. 在 *体质指数计算器* 的 `microservice.yaml` 文件中添加分布式追踪的处理链:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/cn/flow-control.md b/_docs/cn/flow-control.md
index d607b6a..d19c60c 100644
--- a/_docs/cn/flow-control.md
+++ b/_docs/cn/flow-control.md
@@ -28,7 +28,7 @@ last_modified_at: 2017-09-03T10:01:43-04:00
 2. 在 *体质指数计算器* 的 `microservice.yaml` 文件中指明使用流量控制的处理链及指定流控策略:
 
```yaml
-   cse:
+   servicecomb:
  handler:
chain:
  Provider:
diff --git a/_docs/cn/quick-start-bmi.md b/_docs/cn/quick-start-bmi.md
index 594e192..1882ee5 100644
--- a/_docs/cn/quick-start-bmi.md
+++ b/_docs/cn/quick-start-bmi.md
@@ -116,7 +116,7 @@ APPLICATION_ID: bmi
 service_description:
   name: calculator
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
@@ -189,7 +189,7 @@ APPLICATION_ID: bmi
 service_description:
   name: gateway
   version: 0.0.1
-cse:
+servicecomb:
   service:
 registry:
   address: http://127.0.0.1:30100
diff --git a/_docs/cn/quick-start-dataconsistency.md 
b/_docs/cn/quick-start-dataconsistency.md
index d333859..c378ec6 100644
--- a/_docs/cn/quick-start-dataconsistency.md
+++ b/_docs/cn/quick-start-dataconsistency.md
@@ -41,7 +41,7 @@ last_modified_at: 2017-09-19T11:50:10-04:00
service_description:
  name: flight-booking-service
  version: 0.0.1
-   

[incubator-servicecomb-saga] branch master updated: SCB-584 Clear up testing code for Dubbo filter tests

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git


The following commit(s) were added to refs/heads/master by this push:
 new e51c9fa  SCB-584 Clear up testing code for Dubbo filter tests
e51c9fa is described below

commit e51c9fa896d70ad85dd5931c521a72a12f5ee529
Author: Yang Bo 
AuthorDate: Wed May 16 11:21:19 2018 +0800

SCB-584 Clear up testing code for Dubbo filter tests

The IdGenerator is not used thus removed.
Also add omegaContext.clear() in setup to make the tests pass
in linux. But the problem still exists, the filters should use
a better way to get the omegaContext, see SCB-584 for details.
---
 .../src/test/java/SagaDubboConsumerFilterTest.java   | 5 +
 .../src/test/java/SagaDubboProviderFilterTest.java   | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
index d2e7a99..779b732 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
@@ -17,7 +17,6 @@
 
 import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
 import com.alibaba.dubbo.rpc.Invocation;
-import org.apache.servicecomb.saga.omega.context.IdGenerator;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import 
org.apache.servicecomb.saga.omega.transport.dubbo.SagaDubboConsumerFilter;
 import org.junit.After;
@@ -38,8 +37,6 @@ public class SagaDubboConsumerFilterTest {
 
   private static final String globalTxId = UUID.randomUUID().toString();
   private static final String localTxId = UUID.randomUUID().toString();
-  @SuppressWarnings("unchecked")
-  private final IdGenerator idGenerator = mock(IdGenerator.class);
 
   private final OmegaContext omegaContext = new OmegaContext(() -> "ignored");
   private final Invocation invocation = mock(Invocation.class);
@@ -48,7 +45,7 @@ public class SagaDubboConsumerFilterTest {
 
   @Before
   public void setUp() {
-when(idGenerator.nextId()).thenReturn(globalTxId, localTxId);
+omegaContext.clear();
 when(applicationContext.containsBean("omegaContext")).thenReturn(true);
 when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
 SpringExtensionFactory.addApplicationContext(applicationContext);
diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
index 0a5f576..1b95339 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
@@ -45,7 +45,6 @@ public class SagaDubboProviderFilterTest {
   @Before
   public void setUp() {
 omegaContext.clear();
-ApplicationContext applicationContext = mock(ApplicationContext.class);
 when(applicationContext.containsBean("omegaContext")).thenReturn(true);
 when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
 SpringExtensionFactory.addApplicationContext(applicationContext);

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[GitHub] WillemJiang closed pull request #192: [SCB-584] Clear up testing code for Dubbo filter tests

2018-05-17 Thread GitBox
WillemJiang closed pull request #192: [SCB-584] Clear up testing code for Dubbo 
filter tests
URL: https://github.com/apache/incubator-servicecomb-saga/pull/192
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
index e601edac..cae2dcec 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboConsumerFilterTest.java
@@ -17,7 +17,6 @@
 
 import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
 import com.alibaba.dubbo.rpc.Invocation;
-import org.apache.servicecomb.saga.omega.context.IdGenerator;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import 
org.apache.servicecomb.saga.omega.transport.dubbo.SagaDubboConsumerFilter;
 import org.junit.After;
@@ -38,8 +37,6 @@
 
   private static final String globalTxId = UUID.randomUUID().toString();
   private static final String localTxId = UUID.randomUUID().toString();
-  @SuppressWarnings("unchecked")
-  private final IdGenerator idGenerator = mock(IdGenerator.class);
 
   private final OmegaContext omegaContext = new OmegaContext(() -> "ignored");
   private final Invocation invocation = mock(Invocation.class);
@@ -48,7 +45,7 @@
 
   @Before
   public void setUp() {
-when(idGenerator.nextId()).thenReturn(globalTxId, localTxId);
+omegaContext.clear();
 when(applicationContext.containsBean("omegaContext")).thenReturn(true);
 when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
 SpringExtensionFactory.addApplicationContext(applicationContext);
diff --git 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
index 0a5f576a..1b953390 100644
--- 
a/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
+++ 
b/omega/omega-transport/omega-transport-dubbo/src/test/java/SagaDubboProviderFilterTest.java
@@ -45,7 +45,6 @@
   @Before
   public void setUp() {
 omegaContext.clear();
-ApplicationContext applicationContext = mock(ApplicationContext.class);
 when(applicationContext.containsBean("omegaContext")).thenReturn(true);
 when(applicationContext.getBean("omegaContext")).thenReturn(omegaContext);
 SpringExtensionFactory.addApplicationContext(applicationContext);


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #711: [SCB-607]Service registry failed when service before Service Center start complete

2018-05-17 Thread GitBox
coveralls commented on issue #711: [SCB-607]Service registry failed when 
service before Service Center start complete 
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/711#issuecomment-389789849
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17028107/badge)](https://coveralls.io/builds/17028107)
   
   Coverage decreased (-0.005%) to 87.366% when pulling 
**7853f4c9fe9235e52c26a3d8fa84817b4bc0f4e5 on laijianbin:patch-1** into 
**61cda009b7ac8539364bd0f1d1855d804ea4dd27 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-servicecomb-service-center] branch master updated: SCB-393 Retry to request etcd too frequently when fail (#352)

2018-05-17 Thread littlecui
This is an automated email from the ASF dual-hosted git repository.

littlecui pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
 new 0ebf06e   SCB-393 Retry to request etcd too frequently when fail (#352)
0ebf06e is described below

commit 0ebf06e8f082ef9c0ac84cc2040eaa18fc899213
Author: little-cui 
AuthorDate: Thu May 17 16:12:24 2018 +0800

 SCB-393 Retry to request etcd too frequently when fail (#352)

* SCB-393 Retry to request etcd too frequently when fail

* SCB-393 Retry to request etcd too frequently when fail

* SCB-393 Restructure core package

* SCB-393 Restructure core package

* SCB-549 Do not check the instance endpoint whether belong to other service

* SCB-549 Fix UT failure.

* SCB-549 Fix UT failure.

* SCB-549 Fix UT failure.
---
 integration/instances_test.go  |  1 +
 pkg/util/{util_test.go => backoff.go}  | 50 +--
 pkg/util/{util_test.go => backoff_test.go} | 52 ++-
 pkg/util/util.go   | 21 
 pkg/util/util_test.go  | 27 ++
 server/broker/store.go | 58 +++---
 server/core/backend/backend.go |  6 +--
 server/core/backend/{store => }/cache_kv.go| 21 
 server/core/backend/{store => }/cache_null.go  |  2 +-
 server/core/backend/{store => }/cacher.go  |  2 +-
 server/core/backend/{store => }/cacher_test.go |  2 +-
 server/core/backend/{store => }/common.go  |  4 +-
 server/core/backend/{store => }/config.go  |  2 +-
 server/core/backend/{store => }/defer.go   |  2 +-
 server/core/backend/{store => }/defer_instance.go  |  2 +-
 server/core/backend/{store => }/defer_test.go  |  2 +-
 server/core/backend/{store => }/event.go   |  2 +-
 server/core/backend/{store => }/event_proxy.go |  2 +-
 server/core/backend/{store => }/extend.go  |  2 +-
 server/core/backend/{store => }/extend_test.go |  2 +-
 server/core/backend/{store => }/indexer.go | 49 ++
 server/core/backend/{store => }/lease.go   |  5 +-
 server/core/backend/{store => }/listwatch.go   |  4 +-
 server/core/backend/{store => }/metric.go  |  7 ++-
 server/core/backend/{store => }/store.go   |  2 +-
 server/core/info.go| 39 ---
 server/core/key_generator.go   |  2 +-
 server/govern/service.go   | 14 +++---
 server/handler/cache/cache.go  |  4 +-
 server/plugin/infra/quota/buildin/buildin.go   | 12 ++---
 .../infra/registry/embededetcd/embededetcd.go  |  4 +-
 server/plugin/infra/registry/etcd/logger.go|  9 +---
 server/plugin/infra/tracing/buildin/common.go  |  2 +-
 server/server.go   | 44 ++--
 server/service/event/dependency_event_handler.go   | 28 +--
 server/service/event/event.go  | 12 ++---
 server/service/event/instance_event_handler.go |  8 +--
 server/service/event/rule_event_handler.go |  8 +--
 server/service/event/service_event_handler.go  |  8 +--
 server/service/event/tag_event_handler.go  |  8 +--
 server/service/instances.go|  3 --
 server/service/instances_test.go   |  9 
 server/service/microservices.go|  3 +-
 server/service/schema.go   | 13 +++--
 server/service/util/dependency.go  |  9 ++--
 server/service/util/domain_util.go |  7 ++-
 server/service/util/heartbeat_util.go  |  4 +-
 server/service/util/instance_util.go   | 36 --
 server/service/util/instance_util_test.go  |  2 +-
 server/service/util/microservice_util.go   | 20 
 server/service/util/rule_util.go   | 10 ++--
 server/service/util/schema_util.go |  4 +-
 server/service/util/tag_util.go|  3 +-
 53 files changed, 322 insertions(+), 332 deletions(-)

diff --git a/integration/instances_test.go b/integration/instances_test.go
index 948c9f6..5004321 100644
--- a/integration/instances_test.go
+++ b/integration/instances_test.go
@@ -168,6 +168,7 @@ var _ = Describe("MicroService Api Test", func() {
"times":2,
}
instance := map[string]interface{}{
+   "instanceId":  serviceInstanceID,
"endpoints":   endpoints,

[GitHub] little-cui closed pull request #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
little-cui closed pull request #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/352
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/integration/instances_test.go b/integration/instances_test.go
index 948c9f62..50043210 100644
--- a/integration/instances_test.go
+++ b/integration/instances_test.go
@@ -168,6 +168,7 @@ var _ = Describe("MicroService Api Test", func() {
"times":2,
}
instance := map[string]interface{}{
+   "instanceId":  serviceInstanceID,
"endpoints":   endpoints,
"hostName":"cse",
"status":  "UP",
diff --git a/pkg/util/backoff.go b/pkg/util/backoff.go
new file mode 100644
index ..7f96cfd0
--- /dev/null
+++ b/pkg/util/backoff.go
@@ -0,0 +1,51 @@
+/*
+ * 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 util
+
+import (
+   "math"
+   "time"
+)
+
+var DefaultBackoff Backoff = {
+   MaxDelay:  30 * time.Second,
+   InitDelay: 1 * time.Second,
+   Factor:1.6,
+}
+
+type Backoff interface {
+   Delay(retries int) time.Duration
+}
+
+// delay = min(MaxDelay, InitDelay * power(Factor, retries))
+type PowerBackoff struct {
+   MaxDelay  time.Duration
+   InitDelay time.Duration
+   Factorfloat64
+}
+
+func (pb *PowerBackoff) Delay(retries int) time.Duration {
+   if retries <= 0 {
+   return pb.InitDelay
+   }
+
+   return time.Duration(math.Min(float64(pb.MaxDelay), 
float64(pb.InitDelay)*math.Pow(pb.Factor, float64(retries
+}
+
+func GetBackoff() Backoff {
+   return DefaultBackoff
+}
diff --git a/pkg/util/backoff_test.go b/pkg/util/backoff_test.go
new file mode 100644
index ..301a914f
--- /dev/null
+++ b/pkg/util/backoff_test.go
@@ -0,0 +1,57 @@
+/*
+ * 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 util
+
+import (
+   "testing"
+   "time"
+)
+
+func TestPowerBackoff_Delay(t *testing.T) {
+   i, m := time.Second, 30*time.Second
+   b := {
+   MaxDelay:  30 * time.Second,
+   InitDelay: 1 * time.Second,
+   Factor:1.6,
+   }
+   r := b.Delay(-1)
+   if r != i {
+   t.Fatalf("TestPowerBackoff_Delay -1 failed, result is %s", r)
+   }
+   r = b.Delay(0)
+   if r != i {
+   t.Fatalf("TestPowerBackoff_Delay 0 failed, result is %s", r)
+   }
+   r = b.Delay(1)
+   if r != 1600*time.Millisecond {
+   t.Fatalf("TestPowerBackoff_Delay 1 failed, result is %s", r)
+   }
+   r = b.Delay(4)
+   if r != 6553600*time.Microsecond {
+   t.Fatalf("TestPowerBackoff_Delay 4 failed, result is %s", r)
+   }
+   r = b.Delay(8)
+   if r != m {
+   t.Fatalf("TestPowerBackoff_Delay 8 failed, result is %s", r)
+   }
+}
+
+func TestGetBackoff(t *testing.T) {
+   if GetBackoff() == nil {
+   t.Fatalf("TestGetBackoff failed")
+   }
+}
diff 

[GitHub] codecov-io commented on issue #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
codecov-io commented on issue #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/352#issuecomment-389732060
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=h1)
 Report
   > Merging 
[#352](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/3618245c56360a24df606a7daf78586ac006dca3?src=pr=desc)
 will **decrease** coverage by `0.24%`.
   > The diff coverage is `97.43%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/graphs/tree.svg?width=650=pr=GAaF7zrg8R=150)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #352  +/-   ##
   ==
   - Coverage   69.88%   69.64%   -0.25% 
   ==
 Files  18   18  
 Lines3420 3406  -14 
   ==
   - Hits 2390 2372  -18 
   - Misses865  868   +3 
   - Partials  165  166   +1
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/service/instances.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvaW5zdGFuY2VzLmdv)
 | `68.58% <ø> (-2.56%)` | :arrow_down: |
   | 
[server/service/util/heartbeat\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9oZWFydGJlYXRfdXRpbC5nbw==)
 | `80% <100%> (ø)` | :arrow_up: |
   | 
[server/service/microservices.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvbWljcm9zZXJ2aWNlcy5nbw==)
 | `74.55% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/tag\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC90YWdfdXRpbC5nbw==)
 | `65.51% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/dependency.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kZXBlbmRlbmN5Lmdv)
 | `56.37% <100%> (ø)` | :arrow_up: |
   | 
[server/service/schema.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvc2NoZW1hLmdv)
 | `75% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/microservice\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9taWNyb3NlcnZpY2VfdXRpbC5nbw==)
 | `74.84% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/domain\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kb21haW5fdXRpbC5nbw==)
 | `71.64% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/schema\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9zY2hlbWFfdXRpbC5nbw==)
 | `87.5% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/rule\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9ydWxlX3V0aWwuZ28=)
 | `67.5% <100%> (ø)` | :arrow_up: |
   | ... and [2 
more](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=footer).
 Last update 
[3618245...c7f9bad](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
coveralls commented on issue #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/352#issuecomment-389720468
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17027776/badge)](https://coveralls.io/builds/17027776)
   
   Coverage decreased (-0.2%) to 73.206% when pulling 
**c7f9baded846f164d8a789d16d76b024b17ba4a9 on little-cui:master** into 
**3618245c56360a24df606a7daf78586ac006dca3 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
coveralls commented on issue #693: [SCB-548] support gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#issuecomment-387664923
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17027610/badge)](https://coveralls.io/builds/17027610)
   
   Coverage increased (+0.2%) to 87.551% when pulling 
**344fe80816e68dc0ff643e5f994afc313556957e on zhengyangyong:SCB-548** into 
**5c29a7cd224e788cb357e8c640a5f3473ceb0209 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
coveralls commented on issue #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/352#issuecomment-389720468
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17027521/badge)](https://coveralls.io/builds/17027521)
   
   Coverage increased (+0.01%) to 73.376% when pulling 
**d6a2e50d9dd37ab3afb7b771286f115a1aa24c9b on little-cui:master** into 
**3618245c56360a24df606a7daf78586ac006dca3 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong closed pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong closed pull request #693: [SCB-548] support gracefully shutdown
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/693
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/core/src/main/java/org/apache/servicecomb/core/CseApplicationListener.java 
b/core/src/main/java/org/apache/servicecomb/core/CseApplicationListener.java
index 4952f35f3..365868746 100644
--- a/core/src/main/java/org/apache/servicecomb/core/CseApplicationListener.java
+++ b/core/src/main/java/org/apache/servicecomb/core/CseApplicationListener.java
@@ -17,59 +17,23 @@
 
 package org.apache.servicecomb.core;
 
-import java.util.Collection;
-
-import javax.inject.Inject;
-
-import org.apache.servicecomb.core.BootListener.BootEvent;
-import org.apache.servicecomb.core.BootListener.EventType;
 import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
-import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
-import org.apache.servicecomb.core.handler.HandlerConfigUtils;
 import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
-import org.apache.servicecomb.core.provider.consumer.ReferenceConfigUtils;
 import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
 import org.apache.servicecomb.core.transport.TransportManager;
-import org.apache.servicecomb.foundation.common.event.EventManager;
 import org.apache.servicecomb.foundation.common.utils.BeanUtils;
-import org.apache.servicecomb.foundation.common.utils.FortifyUtils;
 import org.apache.servicecomb.serviceregistry.RegistryUtils;
-import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeansException;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 import org.springframework.context.ApplicationEvent;
 import org.springframework.context.ApplicationListener;
-import org.springframework.context.event.ContextClosedEvent;
 import org.springframework.context.event.ContextRefreshedEvent;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.core.Ordered;
-import org.springframework.util.StringUtils;
-
-import com.google.common.eventbus.Subscribe;
 
 public class CseApplicationListener
 implements ApplicationListener, Ordered, 
ApplicationContextAware {
-  private static final Logger LOGGER = 
LoggerFactory.getLogger(CseApplicationListener.class);
-
-  private static boolean isInit = false;
-
-  @Inject
-  private ProducerProviderManager producerProviderManager;
-
-  @Inject
-  private ConsumerProviderManager consumerProviderManager;
-
-  @Inject
-  private TransportManager transportManager;
-
-  @Inject
-  private SchemaListenerManager schemaListenerManager;
-
-  private Collection bootListenerList;
-
   private Class initEventClass = ContextRefreshedEvent.class;
 
   private ApplicationContext applicationContext;
@@ -91,92 +55,22 @@ public int getOrder() {
 return -1000;
   }
 
-  protected void triggerEvent(EventType eventType) {
-BootEvent event = new BootEvent();
-event.setEventType(eventType);
-
-for (BootListener listener : bootListenerList) {
-  listener.onBootEvent(event);
-}
-  }
-
   @Override
   public void onApplicationEvent(ApplicationEvent event) {
 if (initEventClass.isInstance(event)) {
-  //TODO to load when webapplication context is used for discovery client, 
need to check if can use the order and undo this change with proper fix.
-  if (!isInit) {
-try {
-  bootListenerList = 
applicationContext.getBeansOfType(BootListener.class).values();
-
-  AbstractEndpointsCache.init(RegistryUtils.getInstanceCacheManager(), 
transportManager);
-
-  triggerEvent(EventType.BEFORE_HANDLER);
-  HandlerConfigUtils.init();
-  triggerEvent(EventType.AFTER_HANDLER);
-
-  triggerEvent(EventType.BEFORE_PRODUCER_PROVIDER);
-  producerProviderManager.init();
-  triggerEvent(EventType.AFTER_PRODUCER_PROVIDER);
-
-  triggerEvent(EventType.BEFORE_CONSUMER_PROVIDER);
-  consumerProviderManager.init();
-  triggerEvent(EventType.AFTER_CONSUMER_PROVIDER);
-
-  triggerEvent(EventType.BEFORE_TRANSPORT);
-  transportManager.init();
-  triggerEvent(EventType.AFTER_TRANSPORT);
-
-  schemaListenerManager.notifySchemaListener();
-
-  triggerEvent(EventType.BEFORE_REGISTRY);
-
-  triggerAfterRegistryEvent();
-
-  RegistryUtils.run();
-
-  // 当程序退出时,进行相关清理,注意:kill -9 {pid}下无效
-  // 1. 去注册实例信息
-  // TODO 服务优雅退出
-  if 

[GitHub] zhengyangyong opened a new pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong opened a new pull request #693: [SCB-548] support gracefully 
shutdown
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/693
 
 
   Signed-off-by: zhengyangyong 
   
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [x] Each commit in the pull request should have a meaningful subject line 
and body.
- [x] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [x] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [x] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   When user call system.exit(0),these three works will do:
   1.Unregister microservice instance from Service Center:
   this work will do by process ContextClosedEvent, we need unregister 
immediately for stopping provide service any more.
   2.Waiting for all invocations to finish:
   this work will do by ShutdownHandler, when all invocations finished or 
'deadline time reached', cc and transport vertx threads will close.
   3.All spring bean do close process
   we had registerShutdownHook for spring ApplicationContext and beans can 
define 'destroy-method' do cleaning.
   
   here is example:

   Spring mvc Hello Java Chassis
   Pojo Hello person ServiceComb/Java Chassis
   Jaxrs Hello person ServiceComb/Java Chassis
   Spring mvc Hello person ServiceComb/Java Chassis
   2018-05-09 16:02:14,288 [WARN] handler chain is shutting down 
org.apache.servicecomb.core.handler.ShutdownHookHandler.run(ShutdownHookHandler.java:87)
   2018-05-09 16:02:14,289 [INFO] Closing 
org.springframework.context.support.ClassPathXmlApplicationContext@7cf10a6f: 
startup date [Wed May 09 16:02:05 CST 2018]; root of context hierarchy 
org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:984)
   2018-05-09 16:02:14,290 [WARN] cse is closing now... 
org.apache.servicecomb.core.CseApplicationListener.onApplicationEvent(CseApplicationListener.java:148)
   2018-05-09 16:02:14,291 [INFO] service center task is shutdown. 
org.apache.servicecomb.serviceregistry.registry.RemoteServiceRegistry.onShutdown(RemoteServiceRegistry.java:72)
   2018-05-09 16:02:14,295 [WARN] handler chain is shut down 
org.apache.servicecomb.core.handler.ShutdownHookHandler.run(ShutdownHookHandler.java:103)
   2018-05-09 16:02:14,296 [INFO] Unregister microservice instance success. 
microserviceId=90b76fd551c511e8b51db4b676a39f40 
instanceId=481f630d535f11e8bc19b4b676a39f40 
org.apache.servicecomb.serviceregistry.registry.AbstractServiceRegistry.unregisterInstance(AbstractServiceRegistry.java:232)
   Process finished with exit code 0


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] laijianbin opened a new pull request #711: [SCB-607]Service registry failed when service before Service Center start complete

2018-05-17 Thread GitBox
laijianbin opened a new pull request #711: [SCB-607]Service registry failed 
when service before Service Center start complete 
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/711
 
 
   Follow this checklist to help us incorporate your contribution quickly and 
easily:
   
- [ ] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line 
and body.
- [ ] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
issue.
- [ ] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
- [ ] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
- [ ] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] WillemJiang closed pull request #191: SCB-583 update the spring boot version

2018-05-17 Thread GitBox
WillemJiang closed pull request #191: SCB-583 update the spring boot version
URL: https://github.com/apache/incubator-servicecomb-saga/pull/191
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[incubator-servicecomb-saga] branch master updated: SCB-583 Upgrade Spring Boot version to 1.5.13.Release and 2.0.2.Release

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git


The following commit(s) were added to refs/heads/master by this push:
 new 36af2cd  SCB-583 Upgrade Spring Boot version to 1.5.13.Release and 
2.0.2.Release
36af2cd is described below

commit 36af2cd7db636a72addc02cef9c53db2c07d1960
Author: Willem Jiang 
AuthorDate: Wed May 16 08:00:40 2018 +0800

SCB-583 Upgrade Spring Boot version to 1.5.13.Release and 2.0.2.Release
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7a38733..16d8165 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,8 +46,8 @@
 1.8
 0.6.7
 2.6.2
-1.5.10.RELEASE
-2.0.1.RELEASE
+1.5.13.RELEASE
+2.0.2.RELEASE
 Camden.SR6
 1.0.0-m1
 4.3.7.RELEASE

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[incubator-servicecomb-saga] 01/01: SCB-452 Added some java doc

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git

commit 1a7ea7cb065a027d51d477c8d8fcc5967ed33252
Author: Willem Jiang 
AuthorDate: Thu May 17 14:23:59 2018 +0800

SCB-452 Added some java doc
---
 .../java/org/apache/servicecomb/saga/omega/context/OmegaContext.java | 3 +++
 .../java/org/apache/servicecomb/saga/omega/spring/EnableOmega.java   | 5 +
 .../servicecomb/saga/omega/transaction/annotations/Compensable.java  | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/OmegaContext.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/OmegaContext.java
index daa8e7c..8b92868 100644
--- 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/OmegaContext.java
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/OmegaContext.java
@@ -17,6 +17,9 @@
 
 package org.apache.servicecomb.saga.omega.context;
 
+/**
+ * OmegaContext holds the globalTxId and localTxId which are used to build the 
invocation map
+ */
 public class OmegaContext {
   public static final String GLOBAL_TX_ID_KEY = "X-Pack-Global-Transaction-Id";
   public static final String LOCAL_TX_ID_KEY = "X-Pack-Local-Transaction-Id";
diff --git 
a/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/EnableOmega.java
 
b/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/EnableOmega.java
index 7050d29..e94c39e 100644
--- 
a/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/EnableOmega.java
+++ 
b/omega/omega-spring-starter/src/main/java/org/apache/servicecomb/saga/omega/spring/EnableOmega.java
@@ -29,5 +29,10 @@ import 
org.apache.servicecomb.saga.omega.transaction.spring.TransactionAspectCon
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
 @Import({OmegaSpringConfig.class, TransactionAspectConfig.class})
+/**
+ * Indicates create the OmegaContext and inject it into the interceptors
+ * to pass the transactions id across the application.
+ * @see org.apache.servicecomb.saga.omega.context.OmegaContext
+ */
 public @interface EnableOmega {
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Compensable.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Compensable.java
index 78c4b91..b1f9319 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Compensable.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Compensable.java
@@ -29,7 +29,8 @@ import java.lang.annotation.Target;
  *   all parameters are serialized
  *   is idempotent
  *   the object instance which @Compensable method resides in should be 
stateless
- *   if compensationMethod exists, both methods must be commutative, see 
this https://servicecomb.incubator.apache.org/docs/distributed_saga_2/;>link.
+ *   if compensationMethod exists, both methods must be commutative, see 
this
+ *   https://servicecomb.incubator.apache.org/docs/distributed_saga_2/;>link.
  * 
  */
 @Target(ElementType.METHOD)

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[incubator-servicecomb-saga] branch master updated (bd32dea -> 1a7ea7c)

2018-05-17 Thread ningjiang
This is an automated email from the ASF dual-hosted git repository.

ningjiang pushed a change to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-servicecomb-saga.git.


from bd32dea  SCB-573 Split the docker-compose file for debugging easily 
(#190)
 add c04a388  SCB-571 added the miss committed the test file
 new 1a7ea7c  SCB-452 Added some java doc

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:
 .../org/apache/servicecomb/saga/omega/context/OmegaContext.java   | 3 +++
 .../org/apache/servicecomb/saga/omega/spring/EnableOmega.java | 5 +
 .../saga/omega/transaction/annotations/Compensable.java   | 3 ++-
 .../src/test/java/SagaDubboConsumerFilterTest.java| 8 
 4 files changed, 14 insertions(+), 5 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
ningji...@apache.org.


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188849118
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,272 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 

[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188849100
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,272 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 

[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188849091
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBStatus.java
 ##
 @@ -0,0 +1,32 @@
+/*
+ * 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.servicecomb.core;
+
+//DOWN -> STARTING -> UP -> STOPPING -> DOWN
+public enum SCBStatus {
+  //Chassis is Down
+  DOWN,
+  //Chassis is Starting (progressing)
+  STARTING,
+  //Chassis is Running
+  UP,
+  //Chassis is Stopping (progressing)
+  STOPPING,
+  //Chassis Init Failed
+  FAILED
 
 Review comment:
   Done,set to DOWN because no exception will be throw


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] wujimin commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
wujimin commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188847998
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBStatus.java
 ##
 @@ -0,0 +1,32 @@
+/*
+ * 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.servicecomb.core;
+
+//DOWN -> STARTING -> UP -> STOPPING -> DOWN
+public enum SCBStatus {
+  //Chassis is Down
+  DOWN,
+  //Chassis is Starting (progressing)
+  STARTING,
+  //Chassis is Running
+  UP,
+  //Chassis is Stopping (progressing)
+  STOPPING,
+  //Chassis Init Failed
+  FAILED
 
 Review comment:
   currently,  we will only init and uninit only one time
   but i remember your UT will do this multi times?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] zhengyangyong commented on a change in pull request #693: [SCB-548] support gracefully shutdown

2018-05-17 Thread GitBox
zhengyangyong commented on a change in pull request #693: [SCB-548] support 
gracefully shutdown
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/693#discussion_r188847443
 
 

 ##
 File path: core/src/main/java/org/apache/servicecomb/core/SCBEngine.java
 ##
 @@ -0,0 +1,272 @@
+/*
+ * 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.servicecomb.core;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.servicecomb.core.BootListener.BootEvent;
+import org.apache.servicecomb.core.BootListener.EventType;
+import org.apache.servicecomb.core.definition.loader.SchemaListenerManager;
+import org.apache.servicecomb.core.endpoint.AbstractEndpointsCache;
+import org.apache.servicecomb.core.event.InvocationFinishEvent;
+import org.apache.servicecomb.core.event.InvocationStartEvent;
+import org.apache.servicecomb.core.handler.HandlerConfigUtils;
+import org.apache.servicecomb.core.provider.consumer.ConsumerProviderManager;
+import org.apache.servicecomb.core.provider.producer.ProducerProviderManager;
+import org.apache.servicecomb.core.transport.TransportManager;
+import org.apache.servicecomb.foundation.common.event.EventManager;
+import org.apache.servicecomb.foundation.vertx.VertxUtils;
+import org.apache.servicecomb.serviceregistry.RegistryUtils;
+import 
org.apache.servicecomb.serviceregistry.task.MicroserviceInstanceRegisterTask;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import com.google.common.eventbus.AllowConcurrentEvents;
+import com.google.common.eventbus.EventBus;
+import com.google.common.eventbus.Subscribe;
+
+// TODO: should not depend on spring, that will make integration more flexible
+public class SCBEngine {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(SCBEngine.class);
+
+  private ProducerProviderManager producerProviderManager;
+
+  private ConsumerProviderManager consumerProviderManager;
+
+  private TransportManager transportManager;
+
+  private SchemaListenerManager schemaListenerManager;
+
+  private Collection bootListenerList;
+
+  private final AtomicLong invocationStartedCounter = new AtomicLong();
+
+  private final AtomicLong invocationFinishedCounter = new AtomicLong();
+
+  private volatile SCBStatus status = SCBStatus.DOWN;
+
+  public void setStatus(SCBStatus status) {
+this.status = status;
+  }
+
+  public SCBStatus getStatus() {
+return status;
+  }
+
+  private EventBus eventBus = EventManager.getEventBus();
+
+  private static final SCBEngine INSTANCE = new SCBEngine();
+
+  public static SCBEngine getInstance() {
+return INSTANCE;
+  }
+
+  public void setProducerProviderManager(
+  ProducerProviderManager producerProviderManager) {
+this.producerProviderManager = producerProviderManager;
+  }
+
+  public void setConsumerProviderManager(
+  ConsumerProviderManager consumerProviderManager) {
+this.consumerProviderManager = consumerProviderManager;
+  }
+
+  public TransportManager getTransportManager() {
+return transportManager;
+  }
+
+  public void setTransportManager(TransportManager transportManager) {
+this.transportManager = transportManager;
+  }
+
+  public void setSchemaListenerManager(
+  SchemaListenerManager schemaListenerManager) {
+this.schemaListenerManager = schemaListenerManager;
+  }
+
+  public Collection getBootListenerList() {
+return bootListenerList;
+  }
+
+  public void setBootListenerList(Collection bootListenerList) {
+this.bootListenerList = bootListenerList;
+  }
+
+  protected void triggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  listener.onBootEvent(event);
+}
+  }
+
+  protected void safeTriggerEvent(EventType eventType) {
+BootEvent event = new BootEvent();
+event.setEventType(eventType);
+
+for (BootListener listener : bootListenerList) {
+  try {
+listener.onBootEvent(event);
+LOGGER.info("BootListener {} succeed to process {}.", 

[GitHub] coveralls commented on issue #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
coveralls commented on issue #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/352#issuecomment-389720468
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/17026530/badge)](https://coveralls.io/builds/17026530)
   
   Coverage increased (+0.1%) to 73.468% when pulling 
**c8b6f73ad59a46f2c9246489cfc0a9316648e90f on little-cui:master** into 
**3618245c56360a24df606a7daf78586ac006dca3 on apache:master**.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] codecov-io commented on issue #352: SCB-393 Retry to request etcd too frequently when fail

2018-05-17 Thread GitBox
codecov-io commented on issue #352:  SCB-393 Retry to request etcd too 
frequently when fail
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/352#issuecomment-389732060
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=h1)
 Report
   > Merging 
[#352](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/3618245c56360a24df606a7daf78586ac006dca3?src=pr=desc)
 will **increase** coverage by `0.02%`.
   > The diff coverage is `97.43%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/graphs/tree.svg?width=650=pr=GAaF7zrg8R=150)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #352  +/-   ##
   ==
   + Coverage   69.88%   69.91%   +0.02% 
   ==
 Files  18   18  
 Lines3420 3420  
   ==
   + Hits 2390 2391   +1 
 Misses865  865  
   + Partials  165  164   -1
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/service/util/schema\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9zY2hlbWFfdXRpbC5nbw==)
 | `87.5% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/domain\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kb21haW5fdXRpbC5nbw==)
 | `71.64% <100%> (ø)` | :arrow_up: |
   | 
[server/service/microservices.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvbWljcm9zZXJ2aWNlcy5nbw==)
 | `74.55% <100%> (ø)` | :arrow_up: |
   | 
[server/service/schema.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvc2NoZW1hLmdv)
 | `75% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/microservice\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9taWNyb3NlcnZpY2VfdXRpbC5nbw==)
 | `74.84% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/dependency.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9kZXBlbmRlbmN5Lmdv)
 | `56.37% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/heartbeat\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9oZWFydGJlYXRfdXRpbC5nbw==)
 | `80% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/tag\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC90YWdfdXRpbC5nbw==)
 | `65.51% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/rule\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9ydWxlX3V0aWwuZ28=)
 | `67.5% <100%> (ø)` | :arrow_up: |
   | 
[server/service/util/instance\_util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2UvdXRpbC9pbnN0YW5jZV91dGlsLmdv)
 | `48.36% <88.88%> (ø)` | :arrow_up: |
   | ... and [1 
more](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352/diff?src=pr=tree-more)
 | |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=footer).
 Last update 
[3618245...c8b6f73](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/352?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services