[incubator-servicecomb-saga] 02/02: SCB-741 keep the stack trace size below 10240

2018-07-19 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 be00cf4b0f91d1dda19835d3b3c0f1284df2e875
Author: SingleX 
AuthorDate: Fri Jul 20 11:27:55 2018 +0800

SCB-741 keep the stack trace size below 10240
---
 .../servicecomb/saga/omega/transaction/TxAbortedEvent.java   | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
index f0bac54..0a4146a 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
@@ -23,6 +23,9 @@ import java.io.StringWriter;
 import org.apache.servicecomb.saga.common.EventType;
 
 public class TxAbortedEvent extends TxEvent {
+
+  private static final int PAYLOADS_MAX_LENGTH = 10240;
+
   public TxAbortedEvent(String globalTxId, String localTxId, String 
parentTxId, String compensationMethod, Throwable throwable) {
 super(EventType.TxAbortedEvent, globalTxId, localTxId, parentTxId, 
compensationMethod, 0, "", 0,
 stackTrace(throwable));
@@ -31,6 +34,10 @@ public class TxAbortedEvent extends TxEvent {
   private static String stackTrace(Throwable e) {
 StringWriter writer = new StringWriter();
 e.printStackTrace(new PrintWriter(writer));
-return writer.toString();
+String stackTrace = writer.toString();
+if (stackTrace.length() > PAYLOADS_MAX_LENGTH) {
+  stackTrace = stackTrace.substring(0, PAYLOADS_MAX_LENGTH);
+}
+return stackTrace;
   }
 }



[incubator-servicecomb-saga] branch master updated (f05b0ea -> be00cf4)

2018-07-19 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 f05b0ea  [SCB-750] Add missing dependency management
 new f21fd37  SCB-741 change payloads database type from varbinary(10240) 
to blob
 new be00cf4  SCB-741 keep the stack trace size below 10240

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:
 alpha/alpha-server/src/main/resources/schema-mysql.sql   | 4 ++--
 alpha/alpha-server/src/test/resources/schema.sql | 4 ++--
 .../servicecomb/saga/omega/transaction/TxAbortedEvent.java   | 9 -
 3 files changed, 12 insertions(+), 5 deletions(-)



[GitHub] WillemJiang closed pull request #226: SCB-741 change payloads database type from varbinary(10240) to blob

2018-07-19 Thread GitBox
WillemJiang closed pull request #226: SCB-741 change payloads database type 
from varbinary(10240) to blob
URL: https://github.com/apache/incubator-servicecomb-saga/pull/226
 
 
   

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/alpha/alpha-server/src/main/resources/schema-mysql.sql 
b/alpha/alpha-server/src/main/resources/schema-mysql.sql
index ecb934e3..b1598573 100644
--- a/alpha/alpha-server/src/main/resources/schema-mysql.sql
+++ b/alpha/alpha-server/src/main/resources/schema-mysql.sql
@@ -26,7 +26,7 @@ CREATE TABLE IF NOT EXISTS TxEvent (
   type varchar(50) NOT NULL,
   compensationMethod varchar(256) NOT NULL,
   expiryTime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
-  payloads varbinary(10240),
+  payloads blob,
   retries int(11) NOT NULL DEFAULT '0',
   retryMethod varchar(256) DEFAULT NULL,
   PRIMARY KEY (surrogateId),
@@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS Command (
   localTxId varchar(36) NOT NULL,
   parentTxId varchar(36) DEFAULT NULL,
   compensationMethod varchar(256) NOT NULL,
-  payloads varbinary(10240),
+  payloads blob,
   status varchar(12),
   lastModified datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   version bigint NOT NULL,
diff --git a/alpha/alpha-server/src/test/resources/schema.sql 
b/alpha/alpha-server/src/test/resources/schema.sql
index 8d708990..0da26860 100644
--- a/alpha/alpha-server/src/test/resources/schema.sql
+++ b/alpha/alpha-server/src/test/resources/schema.sql
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS TxEvent (
   expiryTime TIMESTAMP NOT NULL,
   retryMethod varchar(256) NOT NULL,
   retries int DEFAULT 0 NOT NULL,
-  payloads varbinary(10240)
+  payloads blob
 );
 
 CREATE TABLE IF NOT EXISTS Command (
@@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS Command (
   localTxId varchar(36) NOT NULL,
   parentTxId varchar(36) DEFAULT NULL,
   compensationMethod varchar(256) NOT NULL,
-  payloads varbinary(10240),
+  payloads blob,
   status varchar(12),
   lastModified TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
   version bigint NOT NULL
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
index f0bac541..0a4146af 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/TxAbortedEvent.java
@@ -23,6 +23,9 @@
 import org.apache.servicecomb.saga.common.EventType;
 
 public class TxAbortedEvent extends TxEvent {
+
+  private static final int PAYLOADS_MAX_LENGTH = 10240;
+
   public TxAbortedEvent(String globalTxId, String localTxId, String 
parentTxId, String compensationMethod, Throwable throwable) {
 super(EventType.TxAbortedEvent, globalTxId, localTxId, parentTxId, 
compensationMethod, 0, "", 0,
 stackTrace(throwable));
@@ -31,6 +34,10 @@ public TxAbortedEvent(String globalTxId, String localTxId, 
String parentTxId, St
   private static String stackTrace(Throwable e) {
 StringWriter writer = new StringWriter();
 e.printStackTrace(new PrintWriter(writer));
-return writer.toString();
+String stackTrace = writer.toString();
+if (stackTrace.length() > PAYLOADS_MAX_LENGTH) {
+  stackTrace = stackTrace.substring(0, PAYLOADS_MAX_LENGTH);
+}
+return stackTrace;
   }
 }


 


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 #825: [SCB-666] Remove assert for AddressResolverOptions

2018-07-19 Thread GitBox
WillemJiang closed pull request #825: [SCB-666] Remove assert for 
AddressResolverOptions
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/825
 
 
   

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/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
index 56b609bf9..5187dc667 100644
--- 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
+++ 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
@@ -80,19 +80,6 @@ public void create() {
 HttpClientPool.INSTANCE.create();
 
 Assert.assertEquals("registry", vertxName);
-Assert.assertEquals(
-"{"
-+ "\"cacheMaxTimeToLive\":2147483647,"
-+ "\"cacheMinTimeToLive\":0,"
-+ "\"cacheNegativeTimeToLive\":0,"
-+ "\"maxQueries\":4,"
-+ "\"ndots\":0,"
-+ "\"optResourceEnabled\":true,"
-+ "\"queryTimeout\":5000,"
-+ "\"rdFlag\":true,"
-+ "\"rotateServers\":false"
-+ "}",
-vertxOptions.getAddressResolverOptions().toJson().toString());
 
 Assert.assertEquals(ClientVerticle.class, verticleCls);
 Assert.assertEquals(ClientPoolManager.class,


 


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-666] Remove assert for AddressResolverOptions

2018-07-19 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 82f098f  [SCB-666] Remove assert for AddressResolverOptions
82f098f is described below

commit 82f098f67745af2659f5a1822f5edc988d9a3402
Author: Yang Bo 
AuthorDate: Fri Jul 20 09:40:46 2018 +0800

[SCB-666] Remove assert for AddressResolverOptions

The AddressResolverOptions just uses the vertx defaults. The conigSource
is set to null when creating. So there is no need to test these options.
---
 .../serviceregistry/client/http/TestAbstractClientPool.java | 13 -
 1 file changed, 13 deletions(-)

diff --git 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
index 56b609b..5187dc6 100644
--- 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
+++ 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/client/http/TestAbstractClientPool.java
@@ -80,19 +80,6 @@ public class TestAbstractClientPool {
 HttpClientPool.INSTANCE.create();
 
 Assert.assertEquals("registry", vertxName);
-Assert.assertEquals(
-"{"
-+ "\"cacheMaxTimeToLive\":2147483647,"
-+ "\"cacheMinTimeToLive\":0,"
-+ "\"cacheNegativeTimeToLive\":0,"
-+ "\"maxQueries\":4,"
-+ "\"ndots\":0,"
-+ "\"optResourceEnabled\":true,"
-+ "\"queryTimeout\":5000,"
-+ "\"rdFlag\":true,"
-+ "\"rotateServers\":false"
-+ "}",
-vertxOptions.getAddressResolverOptions().toJson().toString());
 
 Assert.assertEquals(ClientVerticle.class, verticleCls);
 Assert.assertEquals(ClientPoolManager.class,



[GitHub] wujimin commented on a change in pull request #824: [SCB-687] add highway server connection protection

2018-07-19 Thread GitBox
wujimin commented on a change in pull request #824: [SCB-687] add highway 
server connection protection
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/824#discussion_r203929543
 
 

 ##
 File path: 
foundations/foundation-vertx/src/main/java/org/apache/servicecomb/foundation/vertx/server/TcpServer.java
 ##
 @@ -57,8 +69,18 @@ public void init(Vertx vertx, String sslKey, 
AsyncResultCallback {
-  TcpServerConnection connection = createTcpServerConnection();
-  connection.init(netSocket);
+  if (connectedCounter.get() < connectionLimit) {
 
 Review comment:
   seems this is more clear.
   ```
   if (connectedCounter.incrementAndGet() > connectionLimit){
 connectedCounter.decrementAndGet();
 netSocket.close();
 return;
   }
   
   TcpServerConnection connection = createTcpServerConnection();
   connection.init(netSocket, connectedCounter);
   EventManager.post(new ClientConnectedEvent(netSocket, connectedCount));
   ```


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 edited a comment on issue #223: Dubbo事务补偿问题

2018-07-19 Thread GitBox
WillemJiang edited a comment on issue #223: Dubbo事务补偿问题
URL: 
https://github.com/apache/incubator-servicecomb-saga/issues/223#issuecomment-405547940
 
 
   感觉你是用了MySQL的主从复制功能,这种情况下JPA创建临时表不能同步复制。
   


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 issue #656: bmi项目的log日志没有输出

2018-07-19 Thread GitBox
zhengyangyong commented on issue #656: bmi项目的log日志没有输出
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/656#issuecomment-406473402
 
 
   Hi , we had add a sample : 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/735


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 issue #586: sample下面的bmi例子跑起来了,提交表单数据就报Internal Server Error: com.netflix.zuul.exception.ZuulException错误

2018-07-19 Thread GitBox
zhengyangyong commented on issue #586: sample下面的bmi例子跑起来了,提交表单数据就报Internal 
Server Error: com.netflix.zuul.exception.ZuulException错误
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/586#issuecomment-406473194
 
 
   Hi @soledad000 ,can you provide more detail info such as exception trace 
ect..
   You must start up service center first 
(http://servicecomb.incubator.apache.org/users/setup-environment/)


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 edited a comment on issue #823: [SCB-762] resolve eclipse compile warnings

2018-07-19 Thread GitBox
coveralls edited a comment on issue #823: [SCB-762] resolve eclipse compile 
warnings
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/823#issuecomment-406460006
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18076774/badge)](https://coveralls.io/builds/18076774)
   
   Coverage increased (+0.02%) to 87.1% when pulling 
**d805dbae87f6208886ee697e109b0f88f548ad7c on 
wujimin:resolve-eclipse-compile-warnings** into 
**8227f0ccbe7d69db51df1fc22b11a364662c1d9d 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 issue #654: java-chassis依赖的springboot版本过低

2018-07-19 Thread GitBox
zhengyangyong commented on issue #654: java-chassis依赖的springboot版本过低
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/654#issuecomment-406472581
 
 
   Hi, @msnetc  ,we had upgrade spring boot to **15.12.RELEASE**, 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/673, if you 
have any question, please contact us again


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 issue #654: java-chassis依赖的springboot版本过低

2018-07-19 Thread GitBox
zhengyangyong closed issue #654: java-chassis依赖的springboot版本过低
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/654
 
 
   


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 issue #341: 负载均衡使用问题

2018-07-19 Thread GitBox
zhengyangyong closed issue #341: 负载均衡使用问题
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/341
 
 
   


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 issue #341: 负载均衡使用问题

2018-07-19 Thread GitBox
zhengyangyong commented on issue #341: 负载均衡使用问题
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/341#issuecomment-406471328
 
 
   +1 to @wujimin 
   Hi @sniperLx ,also we had support gracefully shutdown 
(https://github.com/apache/incubator-servicecomb-java-chassis/pull/693) in 
order to enhance it, if you have any question, please contact us again


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] jyseanl opened a new pull request #121: Update links to service-center-1.0.0-m2

2018-07-19 Thread GitBox
jyseanl opened a new pull request #121: Update links to service-center-1.0.0-m2
URL: https://github.com/apache/incubator-servicecomb-website/pull/121
 
 
   Change the links of service center from 1.0.0-m1 to 1.0.0-m2


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 issue #335: 按照文档根本搭建不起来一个可以使用的服务

2018-07-19 Thread GitBox
zhengyangyong commented on issue #335: 按照文档根本搭建不起来一个可以使用的服务
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/335#issuecomment-406470694
 
 
   Hello @xiaoshao ,we had provided 
[archetypes](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/archetypes)
 in order to easier startup.
   Also we had improved docs,if you found any mistake, you can [submit 
PR](http://servicecomb.incubator.apache.org/developers/submit-codes/) to fix it 
, Thanks :+1: 


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 #811: sb版本还是1.5.x何时升级2.x

2018-07-19 Thread GitBox
WillemJiang commented on issue #811: sb版本还是1.5.x何时升级2.x
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/811#issuecomment-406469859
 
 
   spring 5.x still support spring 4.x API. We don't need to do lots of change 
here.


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 issue #304: 通过@RequestBody byte[] buffer接收字节时,为什么必须是json格式的才行

2018-07-19 Thread GitBox
zhengyangyong commented on issue #304: 通过@RequestBody byte[] 
buffer接收字节时,为什么必须是json格式的才行
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/304#issuecomment-406469866
 
 
   +1,
   Hi @zhoudong022 ,you can set request Content-Type as `text/plain` and  make 
a try


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 issue #304: 通过@RequestBody byte[] buffer接收字节时,为什么必须是json格式的才行

2018-07-19 Thread GitBox
zhengyangyong closed issue #304: 通过@RequestBody byte[] 
buffer接收字节时,为什么必须是json格式的才行
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/304
 
 
   


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 issue #298: 啥时候支持流媒体数据传输啊?

2018-07-19 Thread GitBox
zhengyangyong closed issue #298: 啥时候支持流媒体数据传输啊?
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/298
 
 
   


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 issue #298: 啥时候支持流媒体数据传输啊?

2018-07-19 Thread GitBox
zhengyangyong commented on issue #298: 啥时候支持流媒体数据传输啊?
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/298#issuecomment-406469166
 
 
   @zhousujian Hi, we had support this feature, if have any question, please 
contact us again


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 issue #295: request.getinputstream获取不到request body

2018-07-19 Thread GitBox
zhengyangyong closed issue #295: request.getinputstream获取不到request body
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/295
 
 
   


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 issue #295: request.getinputstream获取不到request body

2018-07-19 Thread GitBox
zhengyangyong commented on issue #295: request.getinputstream获取不到request body
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/295#issuecomment-406468867
 
 
   Hi @zhoudong022 , if you have any question,  please contact us again


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 #825: [SCB-666] Remove assert for AddressResolverOptions

2018-07-19 Thread GitBox
coveralls commented on issue #825: [SCB-666] Remove assert for 
AddressResolverOptions
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/825#issuecomment-406468466
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18077226/badge)](https://coveralls.io/builds/18077226)
   
   Coverage remained the same at 87.081% when pulling 
**121655bf149a14348d13a06c13a34c908d5025c5 on yangbor:master** into 
**8227f0ccbe7d69db51df1fc22b11a364662c1d9d 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 issue #293: 方法返回responseEntity类型报错

2018-07-19 Thread GitBox
zhengyangyong closed issue #293: 方法返回responseEntity类型报错
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/293
 
 
   


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 issue #293: 方法返回responseEntity类型报错

2018-07-19 Thread GitBox
zhengyangyong commented on issue #293: 方法返回responseEntity类型报错
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/293#issuecomment-406467926
 
 
   @zhoudong022 we had fix this issue, please try again, if you have any 
question, please contact us


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 issue #279: 关于yaml文件版本号的问题

2018-07-19 Thread GitBox
zhengyangyong commented on issue #279: 关于yaml文件版本号的问题
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/279#issuecomment-406467664
 
 
   @feelanture if you have any question, please contact us


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 issue #279: 关于yaml文件版本号的问题

2018-07-19 Thread GitBox
zhengyangyong closed issue #279: 关于yaml文件版本号的问题
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/279
 
 
   


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 issue #240: 服务端和消费端的启动入口类是哪个?

2018-07-19 Thread GitBox
zhengyangyong commented on issue #240: 服务端和消费端的启动入口类是哪个?
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/240#issuecomment-406467005
 
 
   @lorgine Please check samples under source code,  also you can get more 
information from : 
http://servicecomb.incubator.apache.org/users/application-boot-process/


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 issue #240: 服务端和消费端的启动入口类是哪个?

2018-07-19 Thread GitBox
zhengyangyong closed issue #240: 服务端和消费端的启动入口类是哪个?
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/240
 
 
   


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 issue #238: 多点击BMI Calculator报错

2018-07-19 Thread GitBox
zhengyangyong commented on issue #238: 多点击BMI Calculator报错
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/238#issuecomment-406466594
 
 
   @lorgine I think we may had fixed this issue by : 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/658, you can 
try our latest version `1.0.0-m2`


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 issue #238: 多点击BMI Calculator报错

2018-07-19 Thread GitBox
zhengyangyong closed issue #238: 多点击BMI Calculator报错
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/238
 
 
   


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 issue #237: 按照快速启动教程本地启动后

2018-07-19 Thread GitBox
zhengyangyong closed issue #237: 按照快速启动教程本地启动后
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/237
 
 
   


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 issue #221: What is the difference between samples and demo under root directory. It is so confused. :)

2018-07-19 Thread GitBox
zhengyangyong closed issue #221: What is the difference between samples and 
demo under root directory. It is so confused. :)
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/221
 
 
   


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 issue #221: What is the difference between samples and demo under root directory. It is so confused. :)

2018-07-19 Thread GitBox
zhengyangyong commented on issue #221: What is the difference between samples 
and demo under root directory. It is so confused. :)
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/221#issuecomment-406465589
 
 
   samples : examples for show development
   demo : be used for integration test with docker (will pull up one producer 
and one consuer)
   integration-tests : also be used for integration test with spring boot runner


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 #824: [SCB-687] add highway server connection protection

2018-07-19 Thread GitBox
coveralls commented on issue #824: [SCB-687] add highway server connection 
protection
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/824#issuecomment-406465050
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18077099/badge)](https://coveralls.io/builds/18077099)
   
   Coverage decreased (-0.04%) to 87.041% when pulling 
**2bf89b0a4b2ea14af9862990e4bad5da0d56651a on zhengyangyong:SCB-687** into 
**8227f0ccbe7d69db51df1fc22b11a364662c1d9d 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 edited a comment on issue #155: 关于服务端和客户提供异步调用的能力

2018-07-19 Thread GitBox
zhengyangyong edited a comment on issue #155: 关于服务端和客户提供异步调用的能力
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/155#issuecomment-406464639
 
 
   We had supported `CompletableFuture`


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 issue #155: 关于服务端和客户提供异步调用的能力

2018-07-19 Thread GitBox
zhengyangyong commented on issue #155: 关于服务端和客户提供异步调用的能力
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/155#issuecomment-406464639
 
 
   We had added `CompletableFuture`


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 issue #155: 关于服务端和客户提供异步调用的能力

2018-07-19 Thread GitBox
zhengyangyong closed issue #155: 关于服务端和客户提供异步调用的能力
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/155
 
 
   


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 issue #153: can not find handler :tracing-provider

2018-07-19 Thread GitBox
zhengyangyong closed issue #153: can not find handler :tracing-provider
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/153
 
 
   


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 issue #102: Did you released it to public maven repo?

2018-07-19 Thread GitBox
zhengyangyong commented on issue #102: Did you released it to public maven repo?
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/102#issuecomment-406463912
 
 
   maven central repo :
   
https://www.mvnrepository.com/artifact/org.apache.servicecomb/java-chassis-dependencies


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 issue #102: Did you released it to public maven repo?

2018-07-19 Thread GitBox
zhengyangyong closed issue #102: Did you released it to public maven repo?
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/102
 
 
   


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 issue #82: 能否也提供一个Gradle的build脚本

2018-07-19 Thread GitBox
zhengyangyong closed issue #82: 能否也提供一个Gradle的build脚本
URL: https://github.com/apache/incubator-servicecomb-java-chassis/issues/82
 
 
   


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 issue #82: 能否也提供一个Gradle的build脚本

2018-07-19 Thread GitBox
zhengyangyong commented on issue #82: 能否也提供一个Gradle的build脚本
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/issues/82#issuecomment-406462872
 
 
   We had added in these samples:
   
https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/samples/bmi
   
https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/samples/codefirst-sample


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 #824: [SCB-687] add highway server connection protection

2018-07-19 Thread GitBox
zhengyangyong opened a new pull request #824: [SCB-687] add highway server 
connection protection
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/824
 
 
   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).
   
   ---
   
   Add `servicecomb.highway.server.connection-limit` for setting this limit
   Default value is Integer.MAX_VALUE
   


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 #823: [SCB-762] resolve eclipse compile warnings

2018-07-19 Thread GitBox
coveralls commented on issue #823: [SCB-762] resolve eclipse compile warnings
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/823#issuecomment-406460006
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18076774/badge)](https://coveralls.io/builds/18076774)
   
   Coverage remained the same at 87.081% when pulling 
**d805dbae87f6208886ee697e109b0f88f548ad7c on 
wujimin:resolve-eclipse-compile-warnings** into 
**8227f0ccbe7d69db51df1fc22b11a364662c1d9d 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-website] 01/02: Merge branch 'master' into asf-site

2018-07-19 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 71a12efee1b066e36f702394b337fa070ed637b7
Merge: c63f205 e525e2e
Author: Willem Jiang 
AuthorDate: Fri Jul 20 07:01:57 2018 +0800

Merge branch 'master' into asf-site

 ...07-10-easy-build-microservice-system-part-IV.md | 198 +
 assets/images/scaffold/AuthSuccess.png | Bin 0 -> 100204 bytes
 assets/images/scaffold/EdgeAuth.png| Bin 0 -> 31684 bytes
 assets/images/scaffold/ErrorAuthHeader.png | Bin 0 -> 106784 bytes
 assets/images/scaffold/FilterChain.png | Bin 0 -> 22932 bytes
 assets/images/scaffold/LoginFirst.png  | Bin 0 -> 108269 bytes
 assets/images/scaffold/NoAuthHeader.png| Bin 0 -> 104790 bytes
 7 files changed, 198 insertions(+)



[incubator-servicecomb-website] 03/03: fix pr comments

2018-07-19 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

commit e525e2ea27d8d17e75303d6ec1c9bbaa97961325
Author: zhengyangyong 
AuthorDate: Fri Jul 13 15:14:53 2018 +0800

fix pr comments

Signed-off-by: zhengyangyong 
---
 ...07-10-easy-build-microservice-system-part-IV.md | 129 +
 assets/images/scaffold/FilterChain.png | Bin 22686 -> 22932 bytes
 2 files changed, 27 insertions(+), 102 deletions(-)

diff --git a/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md 
b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
index e79ba84..c1ec64e 100644
--- a/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
+++ b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
@@ -26,13 +26,11 @@ redirect_from:
 
 除此之外其他业务请求都需要做Token认证;
 
-3. 
Edge服务转发访问请求之前,对需要认证的请求先做统一认证,认证通过之后才转发,为了能够未来更好的扩展这种“转发前处理”的能力,我们设计一个处理链机制`FilterChain`:
+3. Edge服务转发访问请求之前,对需要认证的请求先做统一认证,认证通过之后才转发,我们使用`HttpServerFilter`扩展这个能力:
 
 ![FilterChain](/assets/images/scaffold/FilterChain.png)
 
->提示:另外一种方案就是扩展Handler,如果检查失败则使Handler链调用直接返回;但是由于认证过程同样是一个Consumer调用,也会触发Handler
 处理,这会使Handler的逻辑和配置复杂化,因此此场景下不推荐。
-
-完整统一认证时序图为:
+统一认证流程时序图为:
 
 ![EdgeAuth](/assets/images/scaffold/EdgeAuth.png)
 
@@ -69,20 +67,9 @@ public class AuthenticationServiceImpl implements 
AuthenticationService {
 }
 ```
 
- 第二步:实现转发前处理链FilterChain
-# 定义处理链接口EdgeFilter
-```java
-public interface EdgeFilter {
-  //Filter的处理顺序,越小越先被处理
-  int getOrder();
-
-  //如果需要中止Filter链执行,抛InvocationException即可
-  void processing(String serviceName, String operationPath, RoutingContext 
context) throws InvocationException;
-}
-```
-# 实现统一认证AuthenticationFilter
+ 第二步:实现统一认证AuthenticationFilter
 ```java
-public class AuthenticationFilter implements EdgeFilter {
+public class AuthenticationFilter implements HttpServerFilter {
 
   private final RestTemplate template = RestTemplateBuilder.create();
 
@@ -91,7 +78,7 @@ public class AuthenticationFilter implements EdgeFilter {
   public static final String EDGE_AUTHENTICATION_NAME = 
"edge-authentication-name";
 
   private static final Set 
NOT_REQUIRED_VERIFICATION_USER_SERVICE_METHODS = new HashSet<>(
-  Arrays.asList("/login", "/logon", "/validate"));
+  Arrays.asList("login", "logon", "validate"));
 
   @Override
   public int getOrder() {
@@ -99,22 +86,25 @@ public class AuthenticationFilter implements EdgeFilter {
   }
 
   @Override
-  public void processing(String serviceName, String operationPath, 
RoutingContext context) throws InvocationException {
-if (isInvocationNeedValidate(serviceName, operationPath)) {
-  String token = context.request().headers().get(AUTHORIZATION);
+  public Response afterReceiveRequest(Invocation invocation, 
HttpServletRequestEx httpServletRequestEx) {
+if (isInvocationNeedValidate(invocation.getMicroserviceName(), 
invocation.getOperationName())) {
+  String token = httpServletRequestEx.getHeader(AUTHORIZATION);
   if (StringUtils.isNotEmpty(token)) {
 String userName = template
 .getForObject("cse://" + USER_SERVICE_NAME + 
"/validate?token={token}", String.class, token);
 if (StringUtils.isNotEmpty(userName)) {
   //Add header
-  context.request().headers().add(EDGE_AUTHENTICATION_NAME, userName);
+  invocation.getContext().put(EDGE_AUTHENTICATION_NAME, userName);
 } else {
-  throw new InvocationException(Status.UNAUTHORIZED, "authentication 
failed, invalid token");
+  return Response
+  .failResp(new InvocationException(Status.UNAUTHORIZED, 
"authentication failed, invalid token"));
 }
   } else {
-throw new InvocationException(Status.UNAUTHORIZED, "authentication 
failed, missing AUTHORIZATION header");
+return Response.failResp(
+new InvocationException(Status.UNAUTHORIZED, "authentication 
failed, missing AUTHORIZATION header"));
   }
 }
+return null;
   }
 
   private boolean isInvocationNeedValidate(String serviceName, String 
operationPath) {
@@ -130,87 +120,12 @@ public class AuthenticationFilter implements EdgeFilter {
 }
 ```
 
- 第三步:在Edge中添加FilterChain调用机制
-# 在EdgeDispatcher中链式递归的方式顺序调用所有的EdgeFilter
-```java
-  private void onRequest(RoutingContext context) {
-Map pathParams = context.pathParams();
-//从匹配的param0拿到{ServiceComb微服务Name}
-final String service = pathParams.get("param0");
-//从匹配的param1拿到{服务路径&参数}
-String operationPath = "/" + pathParams.get("param1");
-
-
//还记得我们之前说的做出一点点改进吗?引入一个自定义配置edge.routing-short-path.{简称},映射微服务名;如果简称没有配置,那么就认为直接是微服务的名
-final String serviceName = DynamicPropertyFactory.getInstance()
-.getStringProperty("edge.routing-short-path." + service, 
service).get();
-
-  //创建一个Edge转发
-EdgeInvocation edgeInvocation = 

[GitHub] WillemJiang closed pull request #119: 轻松微服务系列:边缘服务支持统一认证

2018-07-19 Thread GitBox
WillemJiang closed pull request #119: 轻松微服务系列:边缘服务支持统一认证
URL: https://github.com/apache/incubator-servicecomb-website/pull/119
 
 
   

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/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md 
b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
new file mode 100644
index ..c1ec64e3
--- /dev/null
+++ b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
@@ -0,0 +1,198 @@
+---
+title: "轻松微服务系列:边缘服务支持统一认证"
+lang: cn
+ref: easy-build-microservice-system-part-IV
+permalink: /cn/docs/easy-build-microservice-system-part-IV/
+excerpt: "轻松微服务系列:边缘服务支持统一认证"
+last_modified_at: 2018-07-10T19:00:00+08:00
+author: Yangyong Zheng
+tags: [Edge Service,API Gateway,Authentication]
+redirect_from:
+  - /theme-setup/
+---
+
+## 轻松微服务系列:边缘服务支持统一认证
+在前一篇博文[《轻松微服务系列:开发高性能边缘服务》](http://servicecomb.incubator.apache.org/cn/docs/easy-build-microservice-system-part-III/),我们开发了具备基本路由能力的高性能边缘服务。这篇博文我们将在Edge服务上实施如何扩展支持统一认证。
+
+### 设计思路
+正如前面的博文提到过,统一认证的目的是在Edge入口处进行访问认证,避免需要在所有的微服务中都承载重复的认证机制,因此:
+1. 
我们先要将认证功能作为一个独立的Procuder发布出来,使Edge服务能够随时认证Token,我们将其命名为`AuthenticationService`,放在用户服务中;
+2. 将无需认证的访问请求识别出来,包括:
+
+| 功能  | 描述 |
+| :--- | :- |
+| login| 登录验证,通过后为用户生成Token |
+| logon| 新用户注册  |
+
+除此之外其他业务请求都需要做Token认证;
+
+3. Edge服务转发访问请求之前,对需要认证的请求先做统一认证,认证通过之后才转发,我们使用`HttpServerFilter`扩展这个能力:
+
+![FilterChain](/assets/images/scaffold/FilterChain.png)
+
+统一认证流程时序图为:
+
+![EdgeAuth](/assets/images/scaffold/EdgeAuth.png)
+
+### 实现统一认证
+ 第一步:发布认证服务
+# 定义AuthenticationService
+```java
+public interface AuthenticationService {
+  String validate(String token);
+}
+```
+# 实现并发布AuthenticationService
+```java
+@RestSchema(schemaId = "authentication")
+@RequestMapping(path = "/")
+public class AuthenticationServiceImpl implements AuthenticationService {
+
+  private final TokenStore tokenStore;
+
+  @Autowired
+  public AuthenticationServiceImpl(TokenStore tokenStore) {
+this.tokenStore = tokenStore;
+  }
+
+  @Override
+  @GetMapping(path = "validate")
+  public String validate(String token) {
+String userName = tokenStore.validate(token);
+if (userName == null) {
+  throw new InvocationException(BAD_REQUEST, "incorrect token");
+}
+return userName;
+  }
+}
+```
+
+ 第二步:实现统一认证AuthenticationFilter
+```java
+public class AuthenticationFilter implements HttpServerFilter {
+
+  private final RestTemplate template = RestTemplateBuilder.create();
+
+  private static final String USER_SERVICE_NAME = "user-service";
+
+  public static final String EDGE_AUTHENTICATION_NAME = 
"edge-authentication-name";
+
+  private static final Set 
NOT_REQUIRED_VERIFICATION_USER_SERVICE_METHODS = new HashSet<>(
+  Arrays.asList("login", "logon", "validate"));
+
+  @Override
+  public int getOrder() {
+return 0;
+  }
+
+  @Override
+  public Response afterReceiveRequest(Invocation invocation, 
HttpServletRequestEx httpServletRequestEx) {
+if (isInvocationNeedValidate(invocation.getMicroserviceName(), 
invocation.getOperationName())) {
+  String token = httpServletRequestEx.getHeader(AUTHORIZATION);
+  if (StringUtils.isNotEmpty(token)) {
+String userName = template
+.getForObject("cse://" + USER_SERVICE_NAME + 
"/validate?token={token}", String.class, token);
+if (StringUtils.isNotEmpty(userName)) {
+  //Add header
+  invocation.getContext().put(EDGE_AUTHENTICATION_NAME, userName);
+} else {
+  return Response
+  .failResp(new InvocationException(Status.UNAUTHORIZED, 
"authentication failed, invalid token"));
+}
+  } else {
+return Response.failResp(
+new InvocationException(Status.UNAUTHORIZED, "authentication 
failed, missing AUTHORIZATION header"));
+  }
+}
+return null;
+  }
+
+  private boolean isInvocationNeedValidate(String serviceName, String 
operationPath) {
+if (USER_SERVICE_NAME.equals(serviceName)) {
+  for (String method : NOT_REQUIRED_VERIFICATION_USER_SERVICE_METHODS) {
+if (operationPath.startsWith(method)) {
+  return false;
+}
+  }
+}
+return true;
+  }
+}
+```
+
+别忘了通过SPI机制加载它,在`resources\META-INF\services`目录中创建`org.apache.servicecomb.common.rest.filter.HttpServerFilter`文件:
+```text
+org.apache.servicecomb.scaffold.edge.filter.AuthenticationFilter
+```
+
+ 第三步:在用户微服务中增加修改密码的功能用于验证
+现有的`login`和`logon`都无需认证,因此我们在用户微服务中增加需要认证的修改密码的功能用于验证统一认证。
+# 在UserService中添加修改密码
+```java
+public interface UserService {
+  ResponseEntity logon(UserDTO user);
+
+  ResponseEntity login(UserDTO user);
+  //需要认证的修改密码功能
+  ResponseEntity changePassword(UserUpdateDTO 

[incubator-servicecomb-website] 02/03: fix style mistake

2018-07-19 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

commit 9f20aca7ac3a167d1919395b2b71d1d60bce9376
Author: zhengyangyong 
AuthorDate: Mon Jul 9 14:10:02 2018 +0800

fix style mistake

Signed-off-by: zhengyangyong 
---
 _posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md 
b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
index 5860f57..e79ba84 100644
--- a/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
+++ b/_posts/cn/2018-07-10-easy-build-microservice-system-part-IV.md
@@ -25,7 +25,8 @@ redirect_from:
 | logon| 新用户注册  |
 
 除此之外其他业务请求都需要做Token认证;
-3. 
Edge服务转发访问请求之前,对需要认证的请求先做统一认证,认证通过之后才转发,为了能够未来更好的扩展这种“转发前处理”的能力,我们设计一个处理链机制——`FilterChain`:
+
+3. 
Edge服务转发访问请求之前,对需要认证的请求先做统一认证,认证通过之后才转发,为了能够未来更好的扩展这种“转发前处理”的能力,我们设计一个处理链机制`FilterChain`:
 
 ![FilterChain](/assets/images/scaffold/FilterChain.png)
 



[GitHub] liubao68 opened a new pull request #822: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
liubao68 opened a new pull request #822: [SCB-760]provide a way to invoke 
service with full path
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/822
 
 
   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] liubao68 commented on issue #821: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
liubao68 commented on issue #821: [SCB-760]provide a way to invoke service with 
full path
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/821#issuecomment-406218156
 
 
   conflicts, abondon


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] liubao68 closed pull request #821: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
liubao68 closed pull request #821: [SCB-760]provide a way to invoke service 
with full path
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/821
 
 
   

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 687a6f4ca..84663b553 100644
--- a/archetypes/README.md
+++ b/archetypes/README.md
@@ -48,5 +48,5 @@ In console Interactive mode, input your GroupId, ArtifactId 
and Version of new p
 *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 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
+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-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 ```
\ No newline at end of file
diff --git 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
index cc93248b5..beab26a74 100644
--- 
a/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
+++ 
b/demo/demo-springmvc/springmvc-client/src/main/java/org/apache/servicecomb/demo/springmvc/client/SpringmvcClient.java
@@ -30,6 +30,7 @@
 import org.apache.servicecomb.foundation.common.utils.Log4jUtils;
 import org.apache.servicecomb.provider.springmvc.reference.CseRestTemplate;
 import org.apache.servicecomb.provider.springmvc.reference.RestTemplateBuilder;
+import 
org.apache.servicecomb.provider.springmvc.reference.UrlWithProviderPrefixClientHttpRequestFactory;
 import 
org.apache.servicecomb.provider.springmvc.reference.UrlWithServiceNameClientHttpRequestFactory;
 import org.apache.servicecomb.swagger.invocation.exception.ExceptionFactory;
 import org.apache.servicecomb.swagger.invocation.exception.InvocationException;
@@ -47,6 +48,8 @@
 public class SpringmvcClient {
   private static RestTemplate templateUrlWithServiceName = new 
CseRestTemplate();
 
+  private static RestTemplate templateUrlWithProviderPrefix = new 
CseRestTemplate();
+
   private static RestTemplate restTemplate;
 
   private static Controller controller;
@@ -65,6 +68,7 @@ public static void run() {
 
 templateUrlWithServiceName.setRequestFactory(new 
UrlWithServiceNameClientHttpRequestFactory());
 restTemplate = RestTemplateBuilder.create();
+templateUrlWithProviderPrefix.setRequestFactory(new 
UrlWithProviderPrefixClientHttpRequestFactory("/pojo/rest"));
 controller = BeanUtils.getBean("controller");
 
 String prefix = "cse://springmvc";
@@ -80,6 +84,7 @@ public static void run() {
 CodeFirstRestTemplateSpringmvc codeFirstClient =
 BeanUtils.getContext().getBean(CodeFirstRestTemplateSpringmvc.class);
 codeFirstClient.testCodeFirst(restTemplate, "springmvc", 
"/codeFirstSpringmvc/");
+codeFirstClient.testCodeFirst(templateUrlWithProviderPrefix, "springmvc", 
"/pojo/rest/codeFirstSpringmvc/");
 
 String microserviceName = "springmvc";
 for (String transport : DemoConst.transports) {
@@ -115,11 +120,13 @@ public static void run() {
 TestMgr.check(true, metrics.size() > 0);
 TestMgr.check(true,
 metrics.get(
-
"servicecomb.invocation(operation=springmvc.codeFirst.saySomething,role=PRODUCER,stage=total,statistic=count,status=200,transport=highway)")
 >= 0);
+
"servicecomb.invocation(operation=springmvc.codeFirst.saySomething,role=PRODUCER,stage=total,statistic=count,status=200,transport=highway)")
+>= 0);
 
 //prometheus integration test
 try {
-  String content = 
restTemplate.getForObject("cse://springmvc/codeFirstSpringmvc/prometheusForTest",
 String.class);
+  String content = restTemplate
+  
.getForObject("cse://springmvc/codeFirstSpringmvc/prometheusForTest", 
String.class);
 
   TestMgr.check(true, 
content.contains("servicecomb_invocation{operation=\"springmvc.codeFirst.addDate"));
   TestMgr.check(true, 
content.contains("servicecomb_invocation{operation=\"springmvc.codeFirst.sayHello"));
diff 

[GitHub] WillemJiang closed pull request #819: [SCB-755] 755 Duplicate copy cse config to Servicecomb config

2018-07-19 Thread GitBox
WillemJiang closed pull request #819: [SCB-755] 755 Duplicate copy cse config 
to Servicecomb config
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/819
 
 
   

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/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
index 21f22426d..284139875 100644
--- 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
+++ 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
@@ -137,8 +137,9 @@ public static ConcurrentCompositeConfiguration 
createLocalConfig(List 
duplicateCseConfigToServicecomb(config,
 new ConcurrentMapConfiguration(configMapEntry.getValue()),
 configMapEntry.getKey()));
-duplicateCseConfigToServicecomb(config,
-new DynamicConfiguration(
+// we have already copy the cse config to the serviceComb config when we 
load the config from local yaml files
+// hence, we do not need duplicate copy it.
+config.addConfiguration( new DynamicConfiguration(
 new MicroserviceConfigurationSource(configModelList), new 
NeverStartPollingScheduler()),
 "configFromYamlFile");
 duplicateCseConfigToServicecombAtFront(config,


 


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] 01/02: 优化日志,不在重复拷贝 本地配置文件中的 cse 配置

2018-07-19 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

commit fbc2981b48d8daeeb36aa3a4117f0ae36c2dbb57
Author: heyile 
AuthorDate: Wed Jul 18 18:01:08 2018 +0800

优化日志,不在重复拷贝 本地配置文件中的 cse 配置
---
 .../src/main/java/org/apache/servicecomb/config/ConfigUtil.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
index 0ec8332..0a0cf16 100644
--- 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
+++ 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
@@ -185,8 +185,11 @@ public final class ConfigUtil {
   private static void 
duplicateCseConfigToServicecomb(ConcurrentCompositeConfiguration 
compositeConfiguration,
   AbstractConfiguration source,
   String sourceName) {
-duplicateCseConfigToServicecomb(source);
 
+//do not duplicate copy cse config to serviceComb config
+if (!"configFromYamlFile".equals(sourceName)) {
+  duplicateCseConfigToServicecomb(source);
+}
 compositeConfiguration.addConfiguration(source, sourceName);
   }
 



[incubator-servicecomb-java-chassis] branch master updated (082b0dc -> 767d4a0)

2018-07-19 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-java-chassis.git.


from 082b0dc  [SCB-729] instance cache check task can be trigger 
periodically or manually
 new fbc2981  优化日志,不在重复拷贝 本地配置文件中的 cse 配置
 new 767d4a0  do not duplicate copy cse config to serviceComb config when 
create local config

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:
 .../src/main/java/org/apache/servicecomb/config/ConfigUtil.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



[incubator-servicecomb-java-chassis] 02/02: do not duplicate copy cse config to serviceComb config when create local config

2018-07-19 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

commit 767d4a0c8ec1a0b41b2283df76abaf39dad1c089
Author: heyile 
AuthorDate: Thu Jul 19 09:30:06 2018 +0800

do not duplicate copy cse config to serviceComb config when create local 
config
---
 .../main/java/org/apache/servicecomb/config/ConfigUtil.java| 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
index 0a0cf16..fd549b5 100644
--- 
a/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
+++ 
b/foundations/foundation-config/src/main/java/org/apache/servicecomb/config/ConfigUtil.java
@@ -137,8 +137,9 @@ public final class ConfigUtil {
 .forEachOrdered(configMapEntry -> 
duplicateCseConfigToServicecomb(config,
 new ConcurrentMapConfiguration(configMapEntry.getValue()),
 configMapEntry.getKey()));
-duplicateCseConfigToServicecomb(config,
-new DynamicConfiguration(
+// we have already copy the cse config to the serviceComb config when we 
load the config from local yaml files
+// hence, we do not need duplicate copy it.
+config.addConfiguration( new DynamicConfiguration(
 new MicroserviceConfigurationSource(configModelList), new 
NeverStartPollingScheduler()),
 "configFromYamlFile");
 duplicateCseConfigToServicecombAtFront(config,
@@ -185,11 +186,8 @@ public final class ConfigUtil {
   private static void 
duplicateCseConfigToServicecomb(ConcurrentCompositeConfiguration 
compositeConfiguration,
   AbstractConfiguration source,
   String sourceName) {
+duplicateCseConfigToServicecomb(source);
 
-//do not duplicate copy cse config to serviceComb config
-if (!"configFromYamlFile".equals(sourceName)) {
-  duplicateCseConfigToServicecomb(source);
-}
 compositeConfiguration.addConfiguration(source, sourceName);
   }
 



[GitHub] wujimin commented on a change in pull request #821: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
wujimin commented on a change in pull request #821: [SCB-760]provide a way to 
invoke service with full path
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/821#discussion_r203655091
 
 

 ##
 File path: 
providers/provider-springmvc/src/main/java/org/apache/servicecomb/provider/springmvc/reference/UrlWithProviderPrefixClientHttpRequestFactory.java
 ##
 @@ -0,0 +1,56 @@
+/*
+ * 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.provider.springmvc.reference;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.http.client.ClientHttpRequest;
+import org.springframework.http.client.ClientHttpRequestFactory;
+
+/**
 
 Review comment:
   already support this?
   
org.apache.servicecomb.transport.rest.client.http.RestClientInvocation#createRequestPath


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 #821: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
wujimin commented on a change in pull request #821: [SCB-760]provide a way to 
invoke service with full path
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/821#discussion_r203655091
 
 

 ##
 File path: 
providers/provider-springmvc/src/main/java/org/apache/servicecomb/provider/springmvc/reference/UrlWithProviderPrefixClientHttpRequestFactory.java
 ##
 @@ -0,0 +1,56 @@
+/*
+ * 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.provider.springmvc.reference;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.springframework.http.HttpMethod;
+import org.springframework.http.client.ClientHttpRequest;
+import org.springframework.http.client.ClientHttpRequestFactory;
+
+/**
 
 Review comment:
   already support this?
   
org.apache.servicecomb.transport.rest.client.http.RestClientInvocation#createRequestPath


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] liubao68 opened a new pull request #821: [SCB-760]provide a way to invoke service with full path

2018-07-19 Thread GitBox
liubao68 opened a new pull request #821: [SCB-760]provide a way to invoke 
service with full path
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/821
 
 
   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


[incubator-servicecomb-website] 01/03: Publish the website

2018-07-19 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 63aae5f2aea374553c000d22f58eb495f12528ba
Author: Willem Jiang 
AuthorDate: Thu Jul 19 14:26:05 2018 +0800

Publish the website
---
 content/assets/images/scaffold/DirectInvoke.png| Bin 0 -> 7713 bytes
 .../scaffold/EdgeOnlySupportConsumerHandler.png| Bin 0 -> 14500 bytes
 content/assets/images/scaffold/InvokeViaEdge.png   | Bin 0 -> 19978 bytes
 content/assets/images/scaffold/LoginViaEdge.png| Bin 0 -> 108503 bytes
 content/assets/images/scaffold/LogonViaEdge.png| Bin 0 -> 99103 bytes
 .../images/scaffold/PerformanceTestDeploy.png  | Bin 0 -> 9400 bytes
 .../docs/apache-servicecomb-day-slides/index.html  |   4 +-
 .../apache-servicecomb-incubating-day/index.html   |   4 +-
 .../index.html | 217 --
 .../index.html |   2 +-
 content/cn/year-archive/index.html | 184 
 .../index.html |   4 +-
 .../apache-servicecomb-incubating-day/index.html   |   6 +-
 content/feed.xml   | 463 +++--
 content/sitemap.xml|   4 +
 content/sitemap/index.html |   2 +
 content/users/service-heartbeat/index.html |   2 +-
 17 files changed, 531 insertions(+), 361 deletions(-)

diff --git a/content/assets/images/scaffold/DirectInvoke.png 
b/content/assets/images/scaffold/DirectInvoke.png
new file mode 100644
index 000..ec53d06
Binary files /dev/null and b/content/assets/images/scaffold/DirectInvoke.png 
differ
diff --git a/content/assets/images/scaffold/EdgeOnlySupportConsumerHandler.png 
b/content/assets/images/scaffold/EdgeOnlySupportConsumerHandler.png
new file mode 100644
index 000..6497a83
Binary files /dev/null and 
b/content/assets/images/scaffold/EdgeOnlySupportConsumerHandler.png differ
diff --git a/content/assets/images/scaffold/InvokeViaEdge.png 
b/content/assets/images/scaffold/InvokeViaEdge.png
new file mode 100644
index 000..2d2c26f
Binary files /dev/null and b/content/assets/images/scaffold/InvokeViaEdge.png 
differ
diff --git a/content/assets/images/scaffold/LoginViaEdge.png 
b/content/assets/images/scaffold/LoginViaEdge.png
new file mode 100644
index 000..c564507
Binary files /dev/null and b/content/assets/images/scaffold/LoginViaEdge.png 
differ
diff --git a/content/assets/images/scaffold/LogonViaEdge.png 
b/content/assets/images/scaffold/LogonViaEdge.png
new file mode 100644
index 000..f5846c4
Binary files /dev/null and b/content/assets/images/scaffold/LogonViaEdge.png 
differ
diff --git a/content/assets/images/scaffold/PerformanceTestDeploy.png 
b/content/assets/images/scaffold/PerformanceTestDeploy.png
new file mode 100644
index 000..77e8fa4
Binary files /dev/null and 
b/content/assets/images/scaffold/PerformanceTestDeploy.png differ
diff --git a/content/cn/docs/apache-servicecomb-day-slides/index.html 
b/content/cn/docs/apache-servicecomb-day-slides/index.html
index 2515828..251b8aa 100644
--- a/content/cn/docs/apache-servicecomb-day-slides/index.html
+++ b/content/cn/docs/apache-servicecomb-day-slides/index.html
@@ -678,11 +678,11 @@
 
 
   
-如何从一名开源小白成长为Apache Committer
+轻松微服务系列:开发高性能边缘服务
 
   
 
-如何从一名开源小白成长为Apache 
Committer
+轻松微服务系列:开发高性能边缘服务
 
 

diff --git a/content/cn/docs/apache-servicecomb-incubating-day/index.html 
b/content/cn/docs/apache-servicecomb-incubating-day/index.html
index e13384f..4009a12 100644
--- a/content/cn/docs/apache-servicecomb-incubating-day/index.html
+++ b/content/cn/docs/apache-servicecomb-incubating-day/index.html
@@ -718,11 +718,11 @@
 
 
   
-如何从一名开源小白成长为Apache Committer
+轻松微服务系列:开发高性能边缘服务
 
   
 
-如何从一名开源小白成长为Apache 
Committer
+轻松微服务系列:开发高性能边缘服务
 
 

diff --git 
a/content/cn/docs/how-to-grow-up-to-be-an-apache-committer/index.html 
b/content/cn/docs/easy-build-microservice-system-part-III/index.html
similarity index 51%
copy from content/cn/docs/how-to-grow-up-to-be-an-apache-committer/index.html
copy to content/cn/docs/easy-build-microservice-system-part-III/index.html
index 88185e8..0a527e8 100644
--- a/content/cn/docs/how-to-grow-up-to-be-an-apache-committer/index.html
+++ b/content/cn/docs/easy-build-microservice-system-part-III/index.html
@@ -19,12 +19,12 @@
 
 
 
-如何从一名开源小白成长为Apache Committer - Apache ServiceComb (incubating)
+轻松微服务系列:开发高性能边缘服务 - Apache ServiceComb (incubating)
 
 
 
 
-
+
 
 
 
@@ -33,21 +33,21 @@
 
 
 
-
+
 
 
-  http://github.com/pages/apache/incubator-servicecomb-website/cn/docs/how-to-grow-up-to-be-an-apache-committer/;>
-  http://github.com/pages/apache/incubator-servicecomb-website/cn/docs/how-to-grow-up-to-be-an-apache-committer/;>
+  

[incubator-servicecomb-website] 02/03: Merge the master branch

2018-07-19 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 984413e7f36d24f7477b5dde72d77c1c6e02699a
Merge: 63aae5f 40ee158
Author: Willem Jiang 
AuthorDate: Thu Jul 19 15:11:36 2018 +0800

Merge the master branch

 _pages/cn/home.md | 2 +-
 _pages/home.md| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)



[incubator-servicecomb-website] branch asf-site updated (246c2ba -> c63f205)

2018-07-19 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 246c2ba  Merge branch 'master' into asf-site
 new 63aae5f  Publish the website
 add 40ee158  Updated the home page
 new 984413e  Merge the master branch
 new c63f205  Publish the website

The 3 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:
 _pages/cn/home.md  |   2 +-
 _pages/home.md |   2 +-
 .../assets}/images/scaffold/DirectInvoke.png   | Bin
 .../scaffold/EdgeOnlySupportConsumerHandler.png| Bin
 .../assets}/images/scaffold/InvokeViaEdge.png  | Bin
 .../assets}/images/scaffold/LoginViaEdge.png   | Bin
 .../assets}/images/scaffold/LogonViaEdge.png   | Bin
 .../images/scaffold/PerformanceTestDeploy.png  | Bin
 .../docs/apache-servicecomb-day-slides/index.html  |   4 +-
 .../apache-servicecomb-incubating-day/index.html   |   4 +-
 .../index.html | 307 +++---
 .../index.html |   2 +-
 content/cn/index.html  |   2 +-
 content/cn/year-archive/index.html | 184 
 .../index.html |   4 +-
 .../apache-servicecomb-incubating-day/index.html   |   6 +-
 content/feed.xml   | 463 +++--
 content/index.html |   2 +-
 content/sitemap.xml|   4 +
 content/sitemap/index.html |   2 +
 content/users/service-heartbeat/index.html |   2 +-
 21 files changed, 522 insertions(+), 468 deletions(-)
 copy {assets => content/assets}/images/scaffold/DirectInvoke.png (100%)
 copy {assets => 
content/assets}/images/scaffold/EdgeOnlySupportConsumerHandler.png (100%)
 copy {assets => content/assets}/images/scaffold/InvokeViaEdge.png (100%)
 copy {assets => content/assets}/images/scaffold/LoginViaEdge.png (100%)
 copy {assets => content/assets}/images/scaffold/LogonViaEdge.png (100%)
 copy {assets => content/assets}/images/scaffold/PerformanceTestDeploy.png 
(100%)
 copy content/cn/docs/{easy-build-microservice-system-part-I => 
easy-build-microservice-system-part-III}/index.html (52%)



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

2018-07-19 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 c63f205aef55dc11781619e2976a44c740555037
Author: Willem Jiang 
AuthorDate: Thu Jul 19 16:41:08 2018 +0800

Publish the website
---
 content/cn/index.html | 2 +-
 content/feed.xml  | 2 +-
 content/index.html| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/content/cn/index.html b/content/cn/index.html
index ebecbc3..6ed0236 100644
--- a/content/cn/index.html
+++ b/content/cn/index.html
@@ -293,7 +293,7 @@
   
 
   最新新闻
-  微服务 
Meetup:Apache ServiceComb (incubating) Day 详细议程更新了,可免费参加,更可获得参观展台机会  
 ServiceComb 第一个Apache孵化版本发布了!   号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
   https://gitter.im/ServiceCombUsers/Lobby;>Join us at 
Gitter  
+  微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料   ServiceComb 第一个Apache孵化版本发布了!   号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
   https://gitter.im/ServiceCombUsers/Lobby;>Join us at 
Gitter  
   Java-Chassis 发布最新版 
1.0.0-m2   Service-Center 发布最新版 1.0.0-m2 
  Saga releases 发布最新版 0.2.0 
  https://www.youtube.com/watch?v=yrAneJvVC7A;>这个视频演示了如何Service-Center前端直接从浏览器测试已注册的微服务
  
 
 
diff --git a/content/feed.xml b/content/feed.xml
index 5b8dbcf..82f143d 100644
--- a/content/feed.xml
+++ b/content/feed.xml
@@ -1,4 +1,4 @@
-http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-07-12T20:46:46+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
+http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-07-19T15:11:55+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
 
 p​  br /
 ​strongEvent Date/Time/strong: Wednesday, June 27, 2018, 11:00 
– 17:30/p
diff --git a/content/index.html b/content/index.html
index caf8693..175d163 100644
--- a/content/index.html
+++ b/content/index.html
@@ -291,7 +291,7 @@
   
 
   Latest News
-  Microservice 
Meetup: Apache ServiceComb (incubating) Day, detailed agenda updated, attendees 
can freely visit LC3 booth.   ServiceComb 
announces it's first Apache Incubating Release to the community.   
ServiceComb now provides data 
consistency solutions(Saga) in microservice application.   https://gitter.im/ServiceCo [...]
+  Microservice 
Meetup: Apache ServiceComb (incubating) Day slidesServiceComb announces it's first Apache Incubating Release to 
the community.   ServiceComb now provides data 
consistency solutions(Saga) in microservice application.   https://gitter.im/ServiceCombUsers/Lobby;>Join us at Gitter  

   Java-Chassis releases a 
new version 1.0.0-m2   Service-Center releases a new version 
1.0.0-m2   Saga releases a new 
version 0.2.0   https://www.youtube.com/watch?v=yrAneJvVC7A;>Service-Center Frontend can 
be used to test microservices schema directly from web.  
 
 



[incubator-servicecomb-website] 01/01: Updated the home page

2018-07-19 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

commit 40ee158bdd9e0ea02ae578da443823ac955f28ef
Author: Willem Jiang 
AuthorDate: Thu Jul 19 14:26:29 2018 +0800

Updated the home page
---
 _pages/cn/home.md | 2 +-
 _pages/home.md| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/_pages/cn/home.md b/_pages/cn/home.md
index 9a0ba2e..d53809e 100644
--- a/_pages/cn/home.md
+++ b/_pages/cn/home.md
@@ -22,7 +22,7 @@ intro:
 
 
   
-微服务 Meetup:Apache 
ServiceComb (incubating) Day 详细议程更新了,可免费参加,更可获得参观展台机会
+微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料
   
   
 ServiceComb 第一个Apache孵化版本发布了!
diff --git a/_pages/home.md b/_pages/home.md
index 42f60ae..7ef3af6 100644
--- a/_pages/home.md
+++ b/_pages/home.md
@@ -21,7 +21,7 @@ intro:
 
 
   
-Microservice Meetup: 
Apache ServiceComb (incubating) Day, detailed agenda updated, attendees can 
freely visit LC3 booth.
+Microservice Meetup: 
Apache ServiceComb (incubating) Day slides 
   
   
 ServiceComb announces it's first Apache Incubating 
Release to the community.



[incubator-servicecomb-website] branch master updated (811ea77 -> 40ee158)

2018-07-19 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-website.git.


 discard 811ea77  Updated the home page
 new 40ee158  Updated the home page

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (811ea77)
\
 N -- N -- N   refs/heads/master (40ee158)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 _pages/cn/home.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[incubator-servicecomb-java-chassis] branch master updated (cfe2b29 -> 082b0dc)

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

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


from cfe2b29  [SCB-759] fix ServiceComb version
 new 9ebfc05  [SCB-729] check instance cache between sdk and sc
 new c847fe3  [SCB-729] bug fix: local file serviceRegistry did not set 
serviceId in memory
 new 44e1cfe  [SCB-729] enhance ArchaiusUtils.resetConfig to reset more 
thorough
 new df187fc  [SCB-729] RemoteServiceRegistry allow extend register 
scheduled task
 new 082b0dc  [SCB-729] instance cache check task can be trigger 
periodically or manually

The 5 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:
 .../test/scaffolding/config/ArchaiusUtils.java |  22 ++
 .../servicecomb/qps/QpsControllerManagerTest.java  |   4 +-
 .../org/apache/servicecomb/qps/TestConfig.java |  21 +-
 .../qps/TestProviderQpsFlowControlHandler.java |   4 +-
 .../java/org/apache/servicecomb/qps/Utils.java |  37 
 .../client/LocalServiceRegistryClientImpl.java |   7 +-
 .../serviceregistry/consumer/AppManager.java   |   4 +
 .../consumer/MicroserviceManager.java  |   4 +
 .../consumer/MicroserviceVersions.java |  20 +-
 .../serviceregistry/diagnosis/Status.java  |   8 +-
 .../diagnosis/instance/InstanceCacheCheckTask.java | 139 
 .../diagnosis/instance/InstanceCacheChecker.java   | 140 
 .../instance/InstanceCacheResult.java} |  30 ++-
 .../instance/InstanceCacheSummary.java}|  47 +++-
 .../registry/RemoteServiceRegistry.java|  12 +-
 .../registry/ServiceRegistryTaskInitializer.java   |  14 +-
 ...egistry.registry.ServiceRegistryTaskInitializer |   5 +-
 .../consumer/TestMicroserviceVersions.java |   1 +
 .../instance/TestInstanceCacheCheckTask.java   | 151 +
 .../instance/TestInstanceCacheChecker.java | 245 +
 .../registry/TestLocalServiceRegistry.java |  16 ++
 .../registry/TestRemoteServiceRegistry.java|  22 +-
 22 files changed, 872 insertions(+), 81 deletions(-)
 delete mode 100644 
handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/Utils.java
 copy 
core/src/main/java/org/apache/servicecomb/core/tracing/TraceIdGenerator.java => 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/Status.java
 (87%)
 create mode 100644 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/InstanceCacheCheckTask.java
 create mode 100644 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/InstanceCacheChecker.java
 copy 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/{task/event/MicroserviceNotExistEvent.java
 => diagnosis/instance/InstanceCacheResult.java} (69%)
 copy 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/{task/event/MicroserviceNotExistEvent.java
 => diagnosis/instance/InstanceCacheSummary.java} (56%)
 copy core/src/test/java/org/apache/servicecomb/core/provider/Person.java => 
service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
 (79%)
 copy core/src/test/resources/config/log4j.demo.properties => 
service-registry/src/main/resources/META-INF/services/org.apache.servicecomb.serviceregistry.registry.ServiceRegistryTaskInitializer
 (90%)
 create mode 100644 
service-registry/src/test/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/TestInstanceCacheCheckTask.java
 create mode 100644 
service-registry/src/test/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/TestInstanceCacheChecker.java



[incubator-servicecomb-java-chassis] 02/05: [SCB-729] bug fix: local file serviceRegistry did not set serviceId in memory

2018-07-19 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

commit c847fe3aca08581fa2bb1c67c56deec4a210f16b
Author: wujimin 
AuthorDate: Mon Jul 16 15:19:04 2018 +0800

[SCB-729] bug fix: local file serviceRegistry did not set serviceId in 
memory
---
 .../client/LocalServiceRegistryClientImpl.java   |  7 +--
 .../registry/TestLocalServiceRegistry.java   | 16 
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
index 877b886..196cd24 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
@@ -171,8 +171,11 @@ public class LocalServiceRegistryClientImpl implements 
ServiceRegistryClient {
 
   @Override
   public String registerMicroservice(Microservice microservice) {
-String serviceId =
-microservice.getServiceId() == null ? UUID.randomUUID().toString() : 
microservice.getServiceId();
+String serviceId = microservice.getServiceId();
+if (serviceId == null) {
+  serviceId = UUID.randomUUID().toString();
+  microservice.setServiceId(serviceId);
+}
 microserviceIdMap.put(serviceId, microservice);
 
 microserviceInstanceMap.computeIfAbsent(serviceId, k -> new 
ConcurrentHashMap<>());
diff --git 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestLocalServiceRegistry.java
 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestLocalServiceRegistry.java
index d4d2b5d..3b01fe8 100644
--- 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestLocalServiceRegistry.java
+++ 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestLocalServiceRegistry.java
@@ -100,4 +100,20 @@ public class TestLocalServiceRegistry {
 String content = 
serviceRegistry.getServiceRegistryClient().getSchema(microservice.getServiceId(),
 "s1");
 Assert.assertEquals("s1-content", content);
   }
+
+  @Test
+  public void registerMicroservice() {
+ServiceRegistry serviceRegistry = ServiceRegistryFactory.createLocal();
+serviceRegistry.init();
+serviceRegistry.run();
+
+Microservice microservice = new Microservice();
+microservice.setAppId("appId");
+microservice.setServiceName("msName");
+
+String serviceId = 
serviceRegistry.getServiceRegistryClient().registerMicroservice(microservice);
+Microservice remoteMicroservice = 
serviceRegistry.getRemoteMicroservice(serviceId);
+
+Assert.assertEquals(serviceId, remoteMicroservice.getServiceId());
+  }
 }



[GitHub] wujimin closed pull request #809: [SCB-729] Instance cache check

2018-07-19 Thread GitBox
wujimin closed pull request #809: [SCB-729] Instance cache check
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/809
 
 
   

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/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
index d913dc999..ca91ef617 100644
--- 
a/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
+++ 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
@@ -18,6 +18,8 @@
 package org.apache.servicecomb.foundation.test.scaffolding.config;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.springframework.util.ReflectionUtils;
 
@@ -40,23 +42,34 @@
   private static final Field FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL =
   ReflectionUtils.findField(DynamicProperty.class, 
"dynamicPropertySupportImpl");
 
+  private static final Field FIELD_DYNAMIC_PROPERTY_ALL_PROPS = ReflectionUtils
+  .findField(DynamicProperty.class, "ALL_PROPS");
+
+  private static Method updatePropertyMethod =
+  ReflectionUtils.findMethod(DynamicProperty.class, "updateProperty", 
String.class, Object.class);
+
   static {
 FIELD_INSTANCE.setAccessible(true);
 FIELD_CUSTOM_CONFIGURATION_INSTALLED.setAccessible(true);
 FIELD_CONFIG.setAccessible(true);
 FIELD_INITIALIZED_WITH_DEFAULT_CONFIG.setAccessible(true);
 FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL.setAccessible(true);
+FIELD_DYNAMIC_PROPERTY_ALL_PROPS.setAccessible(true);
+updatePropertyMethod.setAccessible(true);
   }
 
   private ArchaiusUtils() {
   }
 
+  @SuppressWarnings("unchecked")
   public static void resetConfig() {
 ReflectionUtils.setField(FIELD_INSTANCE, null, null);
 ReflectionUtils.setField(FIELD_CUSTOM_CONFIGURATION_INSTALLED, null, 
false);
 ReflectionUtils.setField(FIELD_CONFIG, null, null);
 ReflectionUtils.setField(FIELD_INITIALIZED_WITH_DEFAULT_CONFIG, null, 
false);
 ReflectionUtils.setField(FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL, null, null);
+((ConcurrentHashMap) 
ReflectionUtils.getField(FIELD_DYNAMIC_PROPERTY_ALL_PROPS, null))
+.clear();
   }
 
   public static void setProperty(String key, Object value) {
@@ -67,4 +80,13 @@ public static void setProperty(String key, Object value) {
 .getBackingConfigurationSource();
 config.getConfiguration(0).addProperty(key, value);
   }
+
+  /**
+   * difference with setProperty is that, updateProperty value can be null
+   * @param key
+   * @param value
+   */
+  public static void updateProperty(String key, Object value) {
+ReflectionUtils.invokeMethod(updatePropertyMethod, null, key, value);
+  }
 }
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
index 5f7f2821f..44b86b267 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
+++ 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
@@ -422,12 +422,12 @@ public static OperationMeta getMockOperationMeta(String 
microserviceName, String
   }
 
   public static void setConfig(String key, int value) {
-Utils.updateProperty(key, value);
+ArchaiusUtils.setProperty(key, value);
   }
 
   public static void setConfigWithDefaultPrefix(String key, int value) {
 String configKey = Config.CONSUMER_LIMIT_KEY_PREFIX + key;
-Utils.updateProperty(configKey, value);
+ArchaiusUtils.setProperty(configKey, value);
   }
 
   public static void clearState(QpsControllerManager qpsControllerManager) {
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
index 540d3031c..15d1e29b1 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
+++ 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
@@ -17,7 +17,10 @@
 
 package org.apache.servicecomb.qps;
 
+import org.apache.servicecomb.foundation.test.scaffolding.config.ArchaiusUtils;
+import org.junit.AfterClass;
 import org.junit.Assert;
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 /**
@@ -25,20 +28,30 

[incubator-servicecomb-java-chassis] 05/05: [SCB-729] instance cache check task can be trigger periodically or manually

2018-07-19 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

commit 082b0dccfd5d1e2194d9c70c99b9fcb52e7e9b20
Author: wujimin 
AuthorDate: Mon Jul 16 20:38:36 2018 +0800

[SCB-729] instance cache check task can be trigger periodically or manually
---
 .../diagnosis/instance/InstanceCacheCheckTask.java | 139 +++
 ...egistry.registry.ServiceRegistryTaskInitializer |  18 +++
 .../instance/TestInstanceCacheCheckTask.java   | 151 +
 3 files changed, 308 insertions(+)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/InstanceCacheCheckTask.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/InstanceCacheCheckTask.java
new file mode 100644
index 000..b6dd615
--- /dev/null
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/instance/InstanceCacheCheckTask.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.serviceregistry.diagnosis.instance;
+
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.servicecomb.serviceregistry.consumer.AppManager;
+import org.apache.servicecomb.serviceregistry.registry.RemoteServiceRegistry;
+import 
org.apache.servicecomb.serviceregistry.registry.ServiceRegistryTaskInitializer;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.eventbus.EventBus;
+import com.netflix.config.DynamicIntProperty;
+import com.netflix.config.DynamicPropertyFactory;
+import com.netflix.config.DynamicStringProperty;
+
+import io.vertx.core.json.Json;
+
+public class InstanceCacheCheckTask implements ServiceRegistryTaskInitializer {
+  private static final Logger LOGGER = 
LoggerFactory.getLogger(InstanceCacheCheckTask.class);
+
+  private static final int DEFAULT_DIAGNOSE_INSTANCE_CACHE_INTERVAL_IN_HOUR = 
24;
+
+  private static final String CONFIG_PREFIX = 
"servicecomb.service.registry.instance.diagnose.";
+
+  public static final String MANUAL = CONFIG_PREFIX + "manual";
+
+  public static final String AUTO_INTERVAL = CONFIG_PREFIX + "interval";
+
+  // auto task
+  private ScheduledFuture scheduledFuture;
+
+  private AppManager appManager;
+
+  private ScheduledThreadPoolExecutor taskPool;
+
+  private EventBus eventBus;
+
+  private DynamicIntProperty autoCheckIntervalProperty;
+
+  private DynamicStringProperty manualCheckProperty;
+
+  private TimeUnit timeUnit = TimeUnit.HOURS;
+
+  // make test easier
+  public void setTimeUnit(TimeUnit timeUnit) {
+this.timeUnit = timeUnit;
+  }
+
+  public void setAppManager(AppManager appManager) {
+this.appManager = appManager;
+  }
+
+  public void setTaskPool(ScheduledThreadPoolExecutor taskPool) {
+this.taskPool = taskPool;
+  }
+
+  public void setEventBus(EventBus eventBus) {
+this.eventBus = eventBus;
+  }
+
+  public DynamicStringProperty getManualCheckProperty() {
+return manualCheckProperty;
+  }
+
+  public DynamicIntProperty getAutoCheckIntervalProperty() {
+return autoCheckIntervalProperty;
+  }
+
+  @Override
+  public void init(RemoteServiceRegistry remoteServiceRegistry) {
+appManager = remoteServiceRegistry.getAppManager();
+taskPool = remoteServiceRegistry.getTaskPool();
+eventBus = remoteServiceRegistry.getEventBus();
+
+init();
+  }
+
+  protected void init() {
+startAutoTask();
+registerManualTask();
+  }
+
+  private void registerManualTask() {
+// if manual config item changed, then run task once
+manualCheckProperty = 
DynamicPropertyFactory.getInstance().getStringProperty(MANUAL, null, 
this::runTask);
+  }
+
+  protected void startAutoTask() {
+autoCheckIntervalProperty = 
DynamicPropertyFactory.getInstance().getIntProperty(AUTO_INTERVAL,
+DEFAULT_DIAGNOSE_INSTANCE_CACHE_INTERVAL_IN_HOUR,
+this::doStartAutoTask);
+doStartAutoTask();
+  }
+
+  private void doStartAutoTask() {
+if 

[incubator-servicecomb-java-chassis] 04/05: [SCB-729] RemoteServiceRegistry allow extend register scheduled task

2018-07-19 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

commit df187fce58c3d7fc66785a64bff38c7993ebf1f5
Author: wujimin 
AuthorDate: Mon Jul 16 20:30:13 2018 +0800

[SCB-729] RemoteServiceRegistry allow extend register scheduled task
---
 .../registry/RemoteServiceRegistry.java| 12 --
 .../registry/ServiceRegistryTaskInitializer.java   | 26 ++
 .../registry/TestRemoteServiceRegistry.java| 22 +++---
 3 files changed, 55 insertions(+), 5 deletions(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
index e6efa79..8eb4fb2 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
@@ -16,9 +16,11 @@
  */
 package org.apache.servicecomb.serviceregistry.registry;
 
+import java.util.List;
 import java.util.concurrent.ScheduledThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.servicecomb.foundation.common.utils.SPIServiceUtils;
 import org.apache.servicecomb.serviceregistry.client.ServiceRegistryClient;
 import 
org.apache.servicecomb.serviceregistry.client.http.ServiceRegistryClientImpl;
 import org.apache.servicecomb.serviceregistry.config.ServiceRegistryConfig;
@@ -38,6 +40,9 @@ public class RemoteServiceRegistry extends 
AbstractServiceRegistry {
 
   private ScheduledThreadPoolExecutor taskPool;
 
+  private List taskInitializers = 
SPIServiceUtils
+  .getOrLoadSortedService(ServiceRegistryTaskInitializer.class);
+
   public RemoteServiceRegistry(EventBus eventBus, ServiceRegistryConfig 
serviceRegistryConfig,
   MicroserviceDefinition microserviceDefinition) {
 super(eventBus, serviceRegistryConfig, microserviceDefinition);
@@ -77,6 +82,10 @@ public class RemoteServiceRegistry extends 
AbstractServiceRegistry {
 serviceRegistryConfig.getInstancePullInterval(),
 serviceRegistryConfig.getInstancePullInterval(),
 TimeUnit.SECONDS);
+
+for (ServiceRegistryTaskInitializer initializer : taskInitializers) {
+  initializer.init(this);
+}
   }
 
   @Subscribe
@@ -91,8 +100,7 @@ public class RemoteServiceRegistry extends 
AbstractServiceRegistry {
 }
   }
 
-  // for testing
-  ScheduledThreadPoolExecutor getTaskPool() {
+  public ScheduledThreadPoolExecutor getTaskPool() {
 return this.taskPool;
   }
 }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
new file mode 100644
index 000..21cd842
--- /dev/null
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/ServiceRegistryTaskInitializer.java
@@ -0,0 +1,26 @@
+/*
+ * 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.serviceregistry.registry;
+
+public interface ServiceRegistryTaskInitializer {
+  default int getOrder() {
+return 0;
+  }
+
+  void init(RemoteServiceRegistry remoteServiceRegistry);
+}
diff --git 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestRemoteServiceRegistry.java
 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestRemoteServiceRegistry.java
index d46ef93..73483fa 100644
--- 
a/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestRemoteServiceRegistry.java
+++ 
b/service-registry/src/test/java/org/apache/servicecomb/serviceregistry/registry/TestRemoteServiceRegistry.java
@@ -17,12 +17,15 @@
 package org.apache.servicecomb.serviceregistry.registry;
 
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ScheduledFuture;
 

[incubator-servicecomb-java-chassis] 03/05: [SCB-729] enhance ArchaiusUtils.resetConfig to reset more thorough

2018-07-19 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

commit 44e1cfe9fa995a64c16d1658fc70066768b809b4
Author: wujimin 
AuthorDate: Mon Jul 16 20:22:43 2018 +0800

[SCB-729] enhance ArchaiusUtils.resetConfig to reset more thorough
---
 .../test/scaffolding/config/ArchaiusUtils.java | 22 +
 .../servicecomb/qps/QpsControllerManagerTest.java  |  4 +--
 .../org/apache/servicecomb/qps/TestConfig.java | 21 +---
 .../qps/TestProviderQpsFlowControlHandler.java |  4 +--
 .../java/org/apache/servicecomb/qps/Utils.java | 37 --
 5 files changed, 43 insertions(+), 45 deletions(-)

diff --git 
a/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
index d913dc9..ca91ef6 100644
--- 
a/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
+++ 
b/foundations/foundation-test-scaffolding/src/main/java/org/apache/servicecomb/foundation/test/scaffolding/config/ArchaiusUtils.java
@@ -18,6 +18,8 @@
 package org.apache.servicecomb.foundation.test.scaffolding.config;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.springframework.util.ReflectionUtils;
 
@@ -40,23 +42,34 @@ public final class ArchaiusUtils {
   private static final Field FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL =
   ReflectionUtils.findField(DynamicProperty.class, 
"dynamicPropertySupportImpl");
 
+  private static final Field FIELD_DYNAMIC_PROPERTY_ALL_PROPS = ReflectionUtils
+  .findField(DynamicProperty.class, "ALL_PROPS");
+
+  private static Method updatePropertyMethod =
+  ReflectionUtils.findMethod(DynamicProperty.class, "updateProperty", 
String.class, Object.class);
+
   static {
 FIELD_INSTANCE.setAccessible(true);
 FIELD_CUSTOM_CONFIGURATION_INSTALLED.setAccessible(true);
 FIELD_CONFIG.setAccessible(true);
 FIELD_INITIALIZED_WITH_DEFAULT_CONFIG.setAccessible(true);
 FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL.setAccessible(true);
+FIELD_DYNAMIC_PROPERTY_ALL_PROPS.setAccessible(true);
+updatePropertyMethod.setAccessible(true);
   }
 
   private ArchaiusUtils() {
   }
 
+  @SuppressWarnings("unchecked")
   public static void resetConfig() {
 ReflectionUtils.setField(FIELD_INSTANCE, null, null);
 ReflectionUtils.setField(FIELD_CUSTOM_CONFIGURATION_INSTALLED, null, 
false);
 ReflectionUtils.setField(FIELD_CONFIG, null, null);
 ReflectionUtils.setField(FIELD_INITIALIZED_WITH_DEFAULT_CONFIG, null, 
false);
 ReflectionUtils.setField(FIELD_DYNAMIC_PROPERTY_SUPPORTIMPL, null, null);
+((ConcurrentHashMap) 
ReflectionUtils.getField(FIELD_DYNAMIC_PROPERTY_ALL_PROPS, null))
+.clear();
   }
 
   public static void setProperty(String key, Object value) {
@@ -67,4 +80,13 @@ public final class ArchaiusUtils {
 .getBackingConfigurationSource();
 config.getConfiguration(0).addProperty(key, value);
   }
+
+  /**
+   * difference with setProperty is that, updateProperty value can be null
+   * @param key
+   * @param value
+   */
+  public static void updateProperty(String key, Object value) {
+ReflectionUtils.invokeMethod(updatePropertyMethod, null, key, value);
+  }
 }
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
index 5f7f282..44b86b2 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
+++ 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/QpsControllerManagerTest.java
@@ -422,12 +422,12 @@ public class QpsControllerManagerTest {
   }
 
   public static void setConfig(String key, int value) {
-Utils.updateProperty(key, value);
+ArchaiusUtils.setProperty(key, value);
   }
 
   public static void setConfigWithDefaultPrefix(String key, int value) {
 String configKey = Config.CONSUMER_LIMIT_KEY_PREFIX + key;
-Utils.updateProperty(configKey, value);
+ArchaiusUtils.setProperty(configKey, value);
   }
 
   public static void clearState(QpsControllerManager qpsControllerManager) {
diff --git 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
 
b/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
index 540d303..15d1e29 100644
--- 
a/handlers/handler-flowcontrol-qps/src/test/java/org/apache/servicecomb/qps/TestConfig.java
+++ 

[incubator-servicecomb-java-chassis] 01/05: [SCB-729] check instance cache between sdk and sc

2018-07-19 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

commit 9ebfc055a4eb58b42f1a626d7a5031b45b9abcaf
Author: wujimin 
AuthorDate: Mon Jul 16 11:08:12 2018 +0800

[SCB-729] check instance cache between sdk and sc
---
 .../serviceregistry/consumer/AppManager.java   |   4 +
 .../consumer/MicroserviceManager.java  |   4 +
 .../consumer/MicroserviceVersions.java |  20 +-
 .../serviceregistry/diagnosis/Status.java  |  24 ++
 .../diagnosis/instance/InstanceCacheChecker.java   | 140 
 .../diagnosis/instance/InstanceCacheResult.java|  62 ++
 .../diagnosis/instance/InstanceCacheSummary.java   |  79 +++
 .../consumer/TestMicroserviceVersions.java |   1 +
 .../instance/TestInstanceCacheChecker.java | 245 +
 9 files changed, 578 insertions(+), 1 deletion(-)

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/AppManager.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/AppManager.java
index 8093ceb..7cc45e2 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/AppManager.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/AppManager.java
@@ -43,6 +43,10 @@ public class AppManager {
 return microserviceVersionFactory;
   }
 
+  public Map getApps() {
+return apps;
+  }
+
   public void setMicroserviceVersionFactory(MicroserviceVersionFactory 
microserviceVersionFactory) {
 this.microserviceVersionFactory = microserviceVersionFactory;
   }
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceManager.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceManager.java
index a7bd4ae..2d16d0d 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceManager.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceManager.java
@@ -45,6 +45,10 @@ public class MicroserviceManager {
 appManager.getEventBus().register(this);
   }
 
+  public Map getVersionsByName() {
+return versionsByName;
+  }
+
   public MicroserviceVersions getOrCreateMicroserviceVersions(String 
microserviceName) {
 MicroserviceVersions microserviceVersions = 
versionsByName.computeIfAbsent(microserviceName, name -> {
   MicroserviceVersions instance = new MicroserviceVersions(appManager, 
appId, microserviceName);
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
index 169328e..f867f6a 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/consumer/MicroserviceVersions.java
@@ -17,6 +17,7 @@
 
 package org.apache.servicecomb.serviceregistry.consumer;
 
+import java.util.Comparator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -48,8 +49,15 @@ public class MicroserviceVersions {
 
   private String microserviceName;
 
+  // revision and pulledInstances directly equals to SC's response
   private String revision = null;
 
+  private List pulledInstances;
+
+  // instances not always equals to pulledInstances
+  // in the future:
+  //  pulledInstances means all instance
+  //  instances means available instance
   private List instances;
 
   // key is service id
@@ -101,6 +109,14 @@ public class MicroserviceVersions {
 return (T) versions.get(serviceId);
   }
 
+  public String getRevision() {
+return revision;
+  }
+
+  public List getPulledInstances() {
+return pulledInstances;
+  }
+
   public void submitPull() {
 pendingPullCount.incrementAndGet();
 
@@ -127,7 +143,9 @@ public class MicroserviceVersions {
 if (!microserviceInstances.isNeedRefresh()) {
   return;
 }
-List pulledInstances = 
microserviceInstances.getInstancesResponse().getInstances();
+
+pulledInstances = 
microserviceInstances.getInstancesResponse().getInstances();
+
pulledInstances.sort(Comparator.comparing(MicroserviceInstance::getInstanceId));
 String rev = microserviceInstances.getRevision();
 
 safeSetInstances(pulledInstances, rev);
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/Status.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/diagnosis/Status.java
new file mode 100644
index 000..47aedd4
--- /dev/null
+++ 

[incubator-servicecomb-java-chassis] branch master updated: [SCB-759] fix ServiceComb version

2018-07-19 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 cfe2b29  [SCB-759] fix ServiceComb version
cfe2b29 is described below

commit cfe2b299bb58c064d7d87393567abb5acfd89dd0
Author: yaohaishi 
AuthorDate: Thu Jul 19 10:00:39 2018 +0800

[SCB-759] fix ServiceComb version
---
 archetypes/README.md | 2 +-
 samples/bmi/build.gradle | 2 +-
 samples/bmi/calculator/build.gradle  | 2 +-
 samples/bmi/webapp/build.gradle  | 2 +-
 samples/codefirst-sample/build.gradle| 2 +-
 samples/codefirst-sample/codefirst-consumer/build.gradle | 6 +++---
 samples/codefirst-sample/codefirst-provider/build.gradle | 6 +++---
 samples/trust-sample/customer/pom.xml| 2 +-
 samples/trust-sample/hacker/pom.xml  | 2 +-
 samples/trust-sample/pom.xml | 2 +-
 samples/trust-sample/store/pom.xml   | 2 +-
 11 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/archetypes/README.md b/archetypes/README.md
index 687a6f4..84663b5 100644
--- a/archetypes/README.md
+++ b/archetypes/README.md
@@ -48,5 +48,5 @@ In console Interactive mode, input your GroupId, ArtifactId 
and Version of new p
 *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 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
+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-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 ```
\ No newline at end of file
diff --git a/samples/bmi/build.gradle b/samples/bmi/build.gradle
index 3dfb8b5..3b73658 100644
--- a/samples/bmi/build.gradle
+++ b/samples/bmi/build.gradle
@@ -19,7 +19,7 @@ allprojects  {
 apply plugin: 'maven'
 
 group = 'org.apache.servicecomb.samples'
-version = '1.0.0-m2-SNAPSHOT'
+version = '1.0.0-SNAPSHOT'
 }
 
 buildscript {
diff --git a/samples/bmi/calculator/build.gradle 
b/samples/bmi/calculator/build.gradle
index 16223d9..71c0019 100644
--- a/samples/bmi/calculator/build.gradle
+++ b/samples/bmi/calculator/build.gradle
@@ -44,6 +44,6 @@ apply plugin: 'io.spring.dependency-management'
 
 dependencyManagement {
 imports {
-mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-m2-SNAPSHOT'
+mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-SNAPSHOT'
 }
 }
diff --git a/samples/bmi/webapp/build.gradle b/samples/bmi/webapp/build.gradle
index c8973f6..1624d9c 100644
--- a/samples/bmi/webapp/build.gradle
+++ b/samples/bmi/webapp/build.gradle
@@ -44,6 +44,6 @@ apply plugin: 'io.spring.dependency-management'
 
 dependencyManagement {
 imports {
-mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-m2-SNAPSHOT'
+mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-SNAPSHOT'
 }
 }
diff --git a/samples/codefirst-sample/build.gradle 
b/samples/codefirst-sample/build.gradle
index cfff44a..67a7af5 100644
--- a/samples/codefirst-sample/build.gradle
+++ b/samples/codefirst-sample/build.gradle
@@ -19,7 +19,7 @@ allprojects  {
 apply plugin: 'maven'
 
 group = 'org.apache.servicecomb.samples'
-version = '1.0.0-m2-SNAPSHOT'
+version = '1.0.0-SNAPSHOT'
 }
 
 subprojects {
diff --git a/samples/codefirst-sample/codefirst-consumer/build.gradle 
b/samples/codefirst-sample/codefirst-consumer/build.gradle
index 060ad09..90d4ddc 100644
--- a/samples/codefirst-sample/codefirst-consumer/build.gradle
+++ b/samples/codefirst-sample/codefirst-consumer/build.gradle
@@ -21,7 +21,7 @@ dependencies {
 compile group: 'org.apache.servicecomb', name: 'provider-pojo'
 compile group: 'org.apache.servicecomb', name: 'transport-highway'
 compile group: 'org.apache.servicecomb', name: 'transport-rest-vertx'
-compile group: 'org.apache.servicecomb.samples', name: 'common-schema', 
version: '1.0.0-m2-SNAPSHOT'
+compile group: 'org.apache.servicecomb.samples', name: 'common-schema', 
version: '1.0.0-SNAPSHOT'
 compile group: 'org.slf4j', name: 'slf4j-log4j12'
 }
 
@@ -46,6 

[GitHub] WillemJiang closed pull request #820: [SCB-759] fix ServiceComb version

2018-07-19 Thread GitBox
WillemJiang closed pull request #820: [SCB-759] fix ServiceComb version
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/820
 
 
   

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 687a6f4ca..84663b553 100644
--- a/archetypes/README.md
+++ b/archetypes/README.md
@@ -48,5 +48,5 @@ In console Interactive mode, input your GroupId, ArtifactId 
and Version of new p
 *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 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
+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-SNAPSHOT 
-DarchetypeRepository=https://repository.apache.org/content/groups/snapshots-group
 ```
\ No newline at end of file
diff --git a/samples/bmi/build.gradle b/samples/bmi/build.gradle
index 3dfb8b530..3b7365892 100644
--- a/samples/bmi/build.gradle
+++ b/samples/bmi/build.gradle
@@ -19,7 +19,7 @@ allprojects  {
 apply plugin: 'maven'
 
 group = 'org.apache.servicecomb.samples'
-version = '1.0.0-m2-SNAPSHOT'
+version = '1.0.0-SNAPSHOT'
 }
 
 buildscript {
diff --git a/samples/bmi/calculator/build.gradle 
b/samples/bmi/calculator/build.gradle
index 16223d9a0..71c00197b 100644
--- a/samples/bmi/calculator/build.gradle
+++ b/samples/bmi/calculator/build.gradle
@@ -44,6 +44,6 @@ apply plugin: 'io.spring.dependency-management'
 
 dependencyManagement {
 imports {
-mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-m2-SNAPSHOT'
+mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-SNAPSHOT'
 }
 }
diff --git a/samples/bmi/webapp/build.gradle b/samples/bmi/webapp/build.gradle
index c8973f6b8..1624d9cf5 100644
--- a/samples/bmi/webapp/build.gradle
+++ b/samples/bmi/webapp/build.gradle
@@ -44,6 +44,6 @@ apply plugin: 'io.spring.dependency-management'
 
 dependencyManagement {
 imports {
-mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-m2-SNAPSHOT'
+mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-SNAPSHOT'
 }
 }
diff --git a/samples/codefirst-sample/build.gradle 
b/samples/codefirst-sample/build.gradle
index cfff44a76..67a7af595 100644
--- a/samples/codefirst-sample/build.gradle
+++ b/samples/codefirst-sample/build.gradle
@@ -19,7 +19,7 @@ allprojects  {
 apply plugin: 'maven'
 
 group = 'org.apache.servicecomb.samples'
-version = '1.0.0-m2-SNAPSHOT'
+version = '1.0.0-SNAPSHOT'
 }
 
 subprojects {
diff --git a/samples/codefirst-sample/codefirst-consumer/build.gradle 
b/samples/codefirst-sample/codefirst-consumer/build.gradle
index 060ad092e..90d4ddc0f 100644
--- a/samples/codefirst-sample/codefirst-consumer/build.gradle
+++ b/samples/codefirst-sample/codefirst-consumer/build.gradle
@@ -21,7 +21,7 @@ dependencies {
 compile group: 'org.apache.servicecomb', name: 'provider-pojo'
 compile group: 'org.apache.servicecomb', name: 'transport-highway'
 compile group: 'org.apache.servicecomb', name: 'transport-rest-vertx'
-compile group: 'org.apache.servicecomb.samples', name: 'common-schema', 
version: '1.0.0-m2-SNAPSHOT'
+compile group: 'org.apache.servicecomb.samples', name: 'common-schema', 
version: '1.0.0-SNAPSHOT'
 compile group: 'org.slf4j', name: 'slf4j-log4j12'
 }
 
@@ -46,6 +46,6 @@ apply plugin: 'io.spring.dependency-management'
 
 dependencyManagement {
 imports {
-mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-m2-SNAPSHOT'
+mavenBom 
'org.apache.servicecomb:java-chassis-dependencies:1.0.0-SNAPSHOT'
 }
-}
\ No newline at end of file
+}
diff --git a/samples/codefirst-sample/codefirst-provider/build.gradle 
b/samples/codefirst-sample/codefirst-provider/build.gradle
index bb0b845f3..9c85d0717 100644
--- a/samples/codefirst-sample/codefirst-provider/build.gradle
+++ b/samples/codefirst-sample/codefirst-provider/build.gradle
@@ -22,7 +22,7 @@ dependencies {
 compile group: 'org.apache.servicecomb', name: 'provider-springmvc'
 compile group: 'org.apache.servicecomb', name: 'transport-highway'
 compile group: 'org.apache.servicecomb', name: 

[incubator-servicecomb-website] branch master updated: Updated the home page

2018-07-19 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 811ea77  Updated the home page
811ea77 is described below

commit 811ea775b040f6b169f857e551c6685f38b9c49d
Author: Willem Jiang 
AuthorDate: Thu Jul 19 14:26:29 2018 +0800

Updated the home page
---
 _pages/cn/home.md | 2 +-
 _pages/home.md| 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/_pages/cn/home.md b/_pages/cn/home.md
index 9a0ba2e..50cb95c 100644
--- a/_pages/cn/home.md
+++ b/_pages/cn/home.md
@@ -22,7 +22,7 @@ intro:
 
 
   
-微服务 Meetup:Apache 
ServiceComb (incubating) Day 详细议程更新了,可免费参加,更可获得参观展台机会
+微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料
   
   
 ServiceComb 第一个Apache孵化版本发布了!
diff --git a/_pages/home.md b/_pages/home.md
index 42f60ae..7ef3af6 100644
--- a/_pages/home.md
+++ b/_pages/home.md
@@ -21,7 +21,7 @@ intro:
 
 
   
-Microservice Meetup: 
Apache ServiceComb (incubating) Day, detailed agenda updated, attendees can 
freely visit LC3 booth.
+Microservice Meetup: 
Apache ServiceComb (incubating) Day slides 
   
   
 ServiceComb announces it's first Apache Incubating 
Release to the community.