[GitHub] wujimin closed pull request #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails

2018-08-29 Thread GitBox
wujimin closed pull request #880: [SCB-860] Optimize microservice register 
process, abort registry when query microservice id fails
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/880
 
 
   

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/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/LocalServiceRegistryClientImpl.java
index 196cd24d3..cb59717ff 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
@@ -163,10 +163,15 @@ public void init() {
   }
 
   @Override
-  public String getMicroserviceId(String appId, String microserviceName, 
String strVersionRule, String environment) {
+  public Holder getMicroserviceId(String appId, String 
microserviceName, String strVersionRule,
+  String environment) {
 VersionRule versionRule = VersionRuleUtils.getOrCreate(strVersionRule);
 Microservice latest = findLatest(appId, microserviceName, versionRule);
-return latest != null ? latest.getServiceId() : null;
+Holder serviceIdHolder = new Holder<>();
+serviceIdHolder
+.setStatusCode(Status.OK.getStatusCode())
+.setValue(latest != null ? latest.getServiceId() : null);
+return serviceIdHolder;
   }
 
   @Override
@@ -275,7 +280,7 @@ protected Microservice findLatest(String appId, String 
serviceName, VersionRule
   String strVersionRule) {
 MicroserviceInstances instances =
 findServiceInstances(selfMicroserviceId, appId, serviceName, 
strVersionRule, null);
-if(instances.isMicroserviceNotExist()) {
+if (instances.isMicroserviceNotExist()) {
   return null;
 }
 return instances.getInstancesResponse().getInstances();
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
index 4af6d7087..dc41ab71b 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/ServiceRegistryClient.java
@@ -42,7 +42,7 @@
*
* 获取微服务唯一标识
*/
-  String getMicroserviceId(String appId, String microserviceName, String 
versionRule, String environment);
+  Holder getMicroserviceId(String appId, String microserviceName, 
String versionRule, String environment);
 
   /**
*
diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/Holder.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/Holder.java
index e63911a93..41dd4ecdc 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/Holder.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/client/http/Holder.java
@@ -17,17 +17,40 @@
 
 package org.apache.servicecomb.serviceregistry.client.http;
 
+import io.vertx.core.buffer.Buffer;
+
 /**
  * To carry the rest response information.
  * @param  Type of response body
  */
 public class Holder {
+  /**
+   * The deserialized response body
+   */
   T value;
 
   int statusCode;
 
   Throwable throwable;
 
+  /**
+   * In error situation, response body cannot be deserialized to expected 
response type,
+   * so we record raw body.
+   */
+  Buffer rawResponseBody;
+
+  /**
+   * Copy inner state from another holder object, except for {@link #value}
+   * @param fromHolder copy from {@code fromHolder}
+   * @return reference of this holder itself
+   */
+  public Holder copyFrom(Holder fromHolder) {
+this.statusCode = fromHolder.statusCode;
+this.throwable = fromHolder.throwable;
+this.rawResponseBody = fromHolder.rawResponseBody;
+return this;
+  }
+
   public T getValue() {
 return value;
   }
@@ -55,12 +78,22 @@ public Throwable getThrowable() {
 return this;
   }
 
+  public Buffer getRawResponseBody() {
+return rawResponseBody;
+  }
+
+  public Holder setRawResponseBody(Buffer rawResponseBody) {
+this.rawResponseBody = rawResponseBody;
+return this;
+  }
+
   @Override
   public String toString() {
 final StringBuilder sb = new StringBuilder("Holder{");
 sb.append("value=").append(value);
 sb.append(", statusCode=").append(statusCode);
 sb.append(", throwable=").append(throwable);
+sb.append(", rawResponseBody=").append(rawResponseBody);
 sb.append('}');
 

[GitHub] wujimin commented on issue #880: [SCB-860] Optimize microservice register process, abort registry when query microservice id fails

2018-08-29 Thread GitBox
wujimin commented on issue #880: [SCB-860] Optimize microservice register 
process, abort registry when query microservice id fails
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/880#issuecomment-417180478
 
 
   discussed
   no need to do this change, just close it.


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


With regards,
Apache Git Services


[GitHub] imlidian commented on a change in pull request #47: General development dir translation and include img

2018-08-29 Thread GitBox
imlidian commented on a change in pull request #47: General development dir 
translation and include img
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/47#discussion_r213895028
 
 

 ##
 File path: 
java-chassis-reference/en_US/general-development/cross-app-invocation.md
 ##
 @@ -33,14 +33,14 @@ consumer端指定微服务名称调用provider的时候,需要加上provider
 String.class, "ServiceComb");
   ```
 
-- RPC调用方式
+- RPC call method
 
-  当consumer端以RPC方式开发微服务消费者时,声明的服务提供者代理如下:
+  When the consumer client develops a microservice consumer in RPC mode, the 
declared service provider proxy is as follows:
   ```java
 @RpcReference(schemaId = "hello", microserviceName = 
"helloApp:helloProvider")
 private Hello hello;
   ```
-  调用方式和调用同应用下的微服务相同:
+  The calling method and calling are the same as the microservices under the 
application:
 
 Review comment:
   中文就诡异


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 opened a new pull request #885: [SCB-859] Generate traceid

2018-08-29 Thread GitBox
wujimin opened a new pull request #885:  [SCB-859] Generate traceid
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/885
 
 
   1. init traceId for consumer/producer/edge
   - from http header
   - from cse context
   - create new id
   2. support multiple TraceIdGenerators inject by SPI


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 #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
coveralls edited a comment on issue #884: [SCB-873] Make the validation result 
display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#issuecomment-416502909
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18743598/badge)](https://coveralls.io/builds/18743598)
   
   Coverage decreased (-0.07%) to 86.109% when pulling 
**ef9fcfecd3a117cde6193c052b25d4da29b637ca on weichao666:validator** into 
**be33086dbde190ceec425aeea3ae5662fbf6b633 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] weichao666 commented on a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
weichao666 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213889924
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/main/java/org/apache/servicecomb/swagger/invocation/validator/DefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,40 @@
+package org.apache.servicecomb.swagger.invocation.validator;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.validation.ParameterNameProvider;
+
+import org.apache.servicecomb.swagger.generator.core.utils.ParamUtils;
+
+
+public class DefaultParameterNameProviderEx implements ParameterNameProvider {
 
 Review comment:
   done,换成了和hibernate自己实现类的名字相同


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


With regards,
Apache Git Services


[GitHub] weichao666 commented on a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
weichao666 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213889945
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/test/java/org/apache/servicecomb/swagger/invocation/validator/TestDefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,103 @@
+package org.apache.servicecomb.swagger.invocation.validator;
 
 Review comment:
   done


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


With regards,
Apache Git Services


[GitHub] weichao666 commented on a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
weichao666 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213889810
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/main/java/org/apache/servicecomb/swagger/invocation/validator/DefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,40 @@
+package org.apache.servicecomb.swagger.invocation.validator;
 
 Review comment:
   done


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


With regards,
Apache Git Services


[GitHub] weichao666 commented on a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
weichao666 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213889826
 
 

 ##
 File path: 
demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/validation/ValidationServiceClient.java
 ##
 @@ -52,7 +52,7 @@ private static void testValidation() {
   template.postForObject(urlPrefix + "/validate", model, 
ValidationModel.class);
   TestMgr.check(false, true);
 } catch (InvocationException e) {
-  TestMgr.check(e.getErrorData().toString().contains("age"), true);
+  
TestMgr.check(e.getErrorData().toString().contains("propertyPath=errorCode.request.age"),
 true);
 
 Review comment:
   done


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


With regards,
Apache Git Services


[GitHub] Chenhaoqing opened a new issue #281: When TxEndedEvent comes after TxAbortedEvent, it would not be compensated?

2018-08-29 Thread GitBox
Chenhaoqing opened a new issue #281: When TxEndedEvent comes after 
TxAbortedEvent, it would not be compensated?
URL: https://github.com/apache/incubator-servicecomb-saga/issues/281
 
 
   I write a test in AlphaIntegrationTest like this,
   ```Java
 @Test
 public void compensateTxEndedEventAfterOtherTxAborted() {
   String sagaGlobalId = UUID.randomUUID().toString();
   String bookingApplicationLocalId = UUID.randomUUID().toString();
   String carServiceLocalId = UUID.randomUUID().toString();
   String hotelServiceLocalId = UUID.randomUUID().toString();
   
   asyncStub.onConnected(serviceConfig, compensateResponseObserver);
   
   blockingStub
   .onTxEvent(someGrpcEvent(SagaStartedEvent, sagaGlobalId, 
bookingApplicationLocalId));
   
   blockingStub.onTxEvent(someGrpcEvent(TxStartedEvent, sagaGlobalId, 
carServiceLocalId));
   blockingStub.onTxEvent(someGrpcEvent(TxAbortedEvent, sagaGlobalId, 
carServiceLocalId));
   
   blockingStub.onTxEvent(someGrpcEvent(TxStartedEvent, sagaGlobalId, 
hotelServiceLocalId));
   blockingStub.onTxEvent(someGrpcEvent(TxEndedEvent, sagaGlobalId, 
hotelServiceLocalId));
   
   await().atMost(30, SECONDS).until(() -> receivedCommands.size() > 0); 
//fail here
   assertThat(receivedCommands.size(), is(1));
   
   GrpcCompensateCommand command = receivedCommands.poll();
   assertThat(command.getGlobalTxId(), is(sagaGlobalId));
   assertThat(command.getLocalTxId(), is(hotelServiceLocalId));
   assertThat(command.getParentTxId(), is(parentTxId));
   assertThat(command.getCompensationMethod(), is(compensationMethod));
   assertThat(command.getPayloads().toByteArray(), is(payload.getBytes()));
 }
   
   ```
   
   is it a valid testcase?


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 #732: SCB-333 Update to support the date time with JSR-310

2018-08-29 Thread GitBox
liubao68 commented on issue #732: SCB-333 Update to support the date time with 
JSR-310
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/732#issuecomment-417165144
 
 
   We have opened an API to let users to customize RestObjectMapper 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/874. If users 
want to use the feature provided by this PR, they can write their own 
RestObjectMapper. 
   I am going to close this PR since it's not a complete feature. Please feel 
free to add more comments when you have another solutions. 


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 #732: SCB-333 Update to support the date time with JSR-310

2018-08-29 Thread GitBox
liubao68 closed pull request #732: SCB-333 Update to support the date time with 
JSR-310
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/732
 
 
   

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/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
index 6dc1bbb01..927c872f4 100644
--- 
a/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
+++ 
b/common/common-rest/src/main/java/org/apache/servicecomb/common/rest/codec/RestObjectMapper.java
@@ -26,6 +26,7 @@
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.type.TypeFactory;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 
 public final class RestObjectMapper extends ObjectMapper {
   public static final RestObjectMapper INSTANCE = new RestObjectMapper();
@@ -52,6 +53,7 @@ public StringBuffer format(Date date, StringBuffer 
toAppendTo, FieldPosition fie
 getFactory().disable(Feature.AUTO_CLOSE_SOURCE);
 disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
 disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+registerModule(new JavaTimeModule());
   }
 
   public String convertToString(Object value) throws Exception {
diff --git 
a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/TestRestObjectMapper.java
 
b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/TestRestObjectMapper.java
index 1dd335e71..59199aa47 100644
--- 
a/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/TestRestObjectMapper.java
+++ 
b/common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/TestRestObjectMapper.java
@@ -17,11 +17,14 @@
 
 package org.apache.servicecomb.common.rest.codec;
 
+import java.time.LocalDateTime;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 import com.fasterxml.jackson.core.JsonParser.Feature;
 import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.type.TypeFactory;
 
 public class TestRestObjectMapper {
 
@@ -34,4 +37,10 @@ public void testAutoCloseSource() {
   public void testDeserializationFeature() {
 
Assert.assertFalse(RestObjectMapper.INSTANCE.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES));
   }
+
+  @Test
+  public void testJSR310Module() {
+
Assert.assertTrue(RestObjectMapper.INSTANCE.canDeserialize(TypeFactory.defaultInstance().constructType(LocalDateTime.class)));
+
Assert.assertTrue(RestObjectMapper.INSTANCE.canSerialize(LocalDateTime.class));
+  }
 }
diff --git a/foundations/foundation-common/pom.xml 
b/foundations/foundation-common/pom.xml
index d1a369f8b..4a320ba09 100644
--- a/foundations/foundation-common/pom.xml
+++ b/foundations/foundation-common/pom.xml
@@ -39,6 +39,10 @@
   com.fasterxml.jackson.core
   jackson-annotations
 
+
+  com.fasterxml.jackson.datatype
+  jackson-datatype-jsr310
+
 
   org.springframework
   spring-context
diff --git 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/JsonUtils.java
 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/JsonUtils.java
index 75c7b36ef..79545c2cf 100644
--- 
a/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/JsonUtils.java
+++ 
b/foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/utils/JsonUtils.java
@@ -29,6 +29,7 @@
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 
 public final class JsonUtils {
   public static final ObjectMapper OBJ_MAPPER;
@@ -37,6 +38,7 @@
 OBJ_MAPPER = new ObjectMapper();
 OBJ_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
 OBJ_MAPPER.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
+OBJ_MAPPER.registerModule(new JavaTimeModule());
   }
 
   private JsonUtils() {
diff --git 
a/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/utils/TestJsonUtils.java
 
b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/utils/TestJsonUtils.java
new file mode 100644
index 0..fca332c91
--- /dev/null
+++ 
b/foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/utils/TestJsonUtils.java
@@ -0,0 +1,59 @@
+/*
+ * 

[GitHub] liubao68 commented on a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
liubao68 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213882327
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/test/java/org/apache/servicecomb/swagger/invocation/validator/TestDefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,103 @@
+package org.apache.servicecomb.swagger.invocation.validator;
 
 Review comment:
   license


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 a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
liubao68 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213882172
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/main/java/org/apache/servicecomb/swagger/invocation/validator/DefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,40 @@
+package org.apache.servicecomb.swagger.invocation.validator;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.lang.reflect.Parameter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import javax.validation.ParameterNameProvider;
+
+import org.apache.servicecomb.swagger.generator.core.utils.ParamUtils;
+
+
+public class DefaultParameterNameProviderEx implements ParameterNameProvider {
 
 Review comment:
   可以换个名字。比如ParameterParamenterNameProvider。这个是hibernate的实现,其实和它的实现功能是一样的。 


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 a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
liubao68 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213881804
 
 

 ##
 File path: 
demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/validation/ValidationServiceClient.java
 ##
 @@ -52,7 +52,7 @@ private static void testValidation() {
   template.postForObject(urlPrefix + "/validate", model, 
ValidationModel.class);
   TestMgr.check(false, true);
 } catch (InvocationException e) {
-  TestMgr.check(e.getErrorData().toString().contains("age"), true);
+  
TestMgr.check(e.getErrorData().toString().contains("propertyPath=errorCode.request.age"),
 true);
 
 Review comment:
   It's better to add error code check.


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 a change in pull request #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
liubao68 commented on a change in pull request #884: [SCB-873] Make the 
validation result display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#discussion_r213881711
 
 

 ##
 File path: 
swagger/swagger-invocation/invocation-validator/src/main/java/org/apache/servicecomb/swagger/invocation/validator/DefaultParameterNameProviderEx.java
 ##
 @@ -0,0 +1,40 @@
+package org.apache.servicecomb.swagger.invocation.validator;
 
 Review comment:
   Add license


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-docs] 01/04: update java-chassis-reference/en_US/edge/by-servicecomb-sdk.md

2018-08-29 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

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

commit fed7abdc0b60d69b7440d10d1a1bdb247c3d0d20
Author: DeanLee 
AuthorDate: Tue Aug 28 11:50:46 2018 +0800

update java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
---
 .../en_US/edge/by-servicecomb-sdk.md   | 230 ++---
 1 file changed, 114 insertions(+), 116 deletions(-)

diff --git a/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md 
b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
old mode 100644
new mode 100755
index bda6b16..9a9212a
--- a/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
+++ b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
@@ -1,15 +1,15 @@
-# 使用Edge Service做边缘服务
+# Using Edge Service for Edge Services
 
-Edge Service是ServiceComb提供的JAVA网关服务。Edge 
Service作为整个微服务系统对外的接口,向最终用户提供服务,接入RESTful请求,转发给内部微服务。Edge 
Service以开发框架的形式提供,开发者可以非常简单的搭建一个Edge Service服务,通过简单的配置就可以定义路由转发规则。同时Edge 
Service支持强大的扩展能力,服务映射、请求解析、加密解密、鉴权等逻辑都可以通过扩展实现。
+Edge Service is the JAVA gateway service provided by ServiceComb. As the 
external interface of the entire microservice system, the Edge Service provides 
services to end users, accesses RESTful requests, and forwards them to internal 
microservices. The Edge Service is provided in the form of a development 
framework. Developers can easily build an Edge Service service and define 
routing and forwarding rules with a simple configuration. At the same time, 
Edge Service supports powerful expan [...]
 
-Edge 
Service本身也是一个微服务,需遵守所有微服务开发的规则。其本身可以部署为多实例,前端使用负载均衡装置进行负载分发;也可以部署为主备,直接接入用户请求。开发者可以根据Edge
 Service承载的逻辑和业务访问量、组网情况来规划。
+The Edge Service itself is also a microservice that is subject to all 
microservice development rules. It can be deployed as a multi-instance, and the 
front-end uses a load balancing device for load distribution. It can also be 
deployed as a master and backup, and directly access user requests. Developers 
can plan according to the logic and service access and networking conditions 
carried by the Edge Service.
 
-## 开发Edge Service服务
-开发Edge Service和开发一个普通的微服务步骤差不多,开发者可以从导入[ServiceComb Edge Service 
Demo](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/demo/demo-edge)入手。从头搭建项目包含如下几个步骤:
+## Developing Edge Service
+Developing Edge Service is similar to developing a normal microservice. 
Developers can import [ServiceComb Edge Service Demo] 
(https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/demo/demo
 -edge) Start. Building a project from scratch involves the following steps:
 
-* 配置依赖关系
+* Configure dependencies
 
-在项目中加入edge-core的依赖,就可以启动Edge Service的功能。Edge 
Service在请求转发的时候,会经过处理链,因此还可以加入相关的处理链的模块的依赖,下面的实例增加的负载均衡的处理链,这个是必须的。
+By adding edge-core dependencies to your project, you can start the Edge 
Service. When the Edge Service requests forwarding, it will go through the 
processing chain, so it can also join the dependencies of the relevant 
processing chain modules. The following example adds the load balancing 
processing chain. This is a must.
 ```
 
   org.apache.servicecomb
@@ -21,9 +21,9 @@ Edge Service本身也是一个微服务,需遵守所有微服务开发的规
 
 ```
 
-* 定义启动类
+* Define the startup class
 
-和开发普通微服务一样,可以通过加载Spring的方式将服务拉起来。
+Just like developing a normal microservice, you can pull the service by 
loading Spring.
 ```
 public class EdgeMain {
   public static void main(String[] args) throws Exception {
@@ -33,9 +33,8 @@ public class EdgeMain {
 }
 ```
 
-* 增加配置文件microservie.yaml
-
-Edge 
Service本身也是一个微服务,遵循微服务查找的规则,自己也会进行注册。注意APPLICAIONT_ID与需要转发的微服务相同。在下面的配置中,指定了Edge
 Service监听的地址,处理链等信息。其中auth处理链是DEMO项目中自定义的处理链,用于实现认证。同时auth服务本身,不经过这个处理链,相当于不鉴权。
+* Increase the configuration file microservie.yaml
+The Edge Service itself is also a microservice that follows the rules of 
microservice lookup and will register itself. Note that APPLICAIONT_ID is the 
same as the microservice that needs to be forwarded. In the following 
configuration, the address that the Edge Service listens to, the processing 
chain, and so on are specified. The auth processing chain is a custom 
processing chain in the DEMO project for implementing authentication. At the 
same time, the auth service itself, without goin [...]
 ```
 APPLICATION_ID: edge
 service_description:
@@ -55,18 +54,18 @@ servicecomb:
   auth: loadbalance
 ```
 
-## 工作流程
-Edge Service的工作流程如下,蓝色背景部分在Eventloop线程中执行,黄色背景部分:
-  * 如果工作于reactive模式,则直接在Eventloop线程执行
-  * 如果工作于线程池模式,则在线程池的线程中执行
+## work process
+The workflow of the Edge Service is as follows, the blue background part is 
executed in the Eventloop thread, and the yellow background part:
+   * If working in reactive mode, execute directly in the Eventloop thread
+   * If working in thread pool mode, execute in the thread pool thread
 ![](/assets/workFlow.png)
 
-## 定制路由规则
-使用Edge Service的核心工作是配置路由规则。场景不同,规则也不同。

[incubator-servicecomb-docs] 02/04: update java-chassis-reference/en_US/edge/nginx.md

2018-08-29 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

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

commit b3d97218307a3e67b81f87be11beba10becb21c6
Author: DeanLee 
AuthorDate: Tue Aug 28 11:51:01 2018 +0800

update java-chassis-reference/en_US/edge/nginx.md
---
 java-chassis-reference/en_US/edge/nginx.md | 121 ++---
 1 file changed, 60 insertions(+), 61 deletions(-)

diff --git a/java-chassis-reference/en_US/edge/nginx.md 
b/java-chassis-reference/en_US/edge/nginx.md
old mode 100644
new mode 100755
index 2f0d633..4dbed28
--- a/java-chassis-reference/en_US/edge/nginx.md
+++ b/java-chassis-reference/en_US/edge/nginx.md
@@ -1,105 +1,104 @@
-# 使用confd和Nginx做边缘服务
+# Using confd and Nginx for edge services
 
-## 概念阐述
+## Concept Description
 
 ### **confd**
 
-confd是一个轻量级的配置管理工具,源码地址:[https://github.com/kelseyhightower/confd](https://github.com/kelseyhightower/confd),它可以将配置信息存储在etcd、consul、dynamodb、redis以及zookeeper等。confd定期会从这些存储节点pull最新的配置,然后重新加载服务,完成配置文件的更新。
+Confd is a lightweight configuration management tool, source code: 
[https://github.com/kelseyhightower/confd] 
(https://github.com/kelseyhightower/confd), which stores configuration 
information in etcd, Consul, dynamodb, redis, and zookeeper. Confd periodically 
pulls the latest configuration from these storage nodes, then reloads the 
service and completes the configuration file update.
 
 ### **Nginx**
 
-Nginx \(engine 
x\)是一个高性能的HTTP和反向代理服务器,具有负载均衡的功能。详情请参考[http://www.nginx.cn/doc/](http://www.nginx.cn/doc/)。本小节介绍的服务主要使用到的是Nginx的http代理功能。
+Nginx \(engine x\) is a high-performance HTTP and reverse proxy server with 
load balancing capabilities. For details, please refer to 
[http://www.nginx.cn/doc/] (http://www.nginx.cn/doc/). The services introduced 
in this section mainly use the Nginx http proxy function.
 
-## 场景描述
+## Scene Description
 
-本小节介绍的技术是使用nginx+confd做边缘服务,同时可以对接Java 
Chassis微服务框架中的服务中心,从服务中心中拉去服务信息通过confd动态更新nginx的配置。
+The technology introduced in this section is to use nginx+confd as the edge 
service. At the same time, you can dock the service center in the Java Chassis 
microservices framework, and pull the service information from the service 
center to dynamically update the nginx configuration through confd.
 
-使用nginx+confd动态反向代理的实现步骤可参考文章[http://www.cnblogs.com/Anker/p/6112022.html](http://www.cnblogs.com/Anker/p/6112022.html),本节主要介绍confd如何对接Java
 Chassis框架的服务中心。
+The implementation steps of using nginx+confd dynamic reverse proxy can be 
found in the article [http://www.cnblogs.com/Anker/p/6112022.html] 
(http://www.cnblogs.com/Anker/p/6112022. Html), this section mainly introduces 
how confd docks the service center of the Java Chassis framework.
 
-## 对接服务中心
+## Docking Service Center
 
-本节介绍的技术核心在于如何使得confd获取到服务中心的服务信息,服务中心开放了以下接口供外部调用:
+The core of the technology introduced in this section is how to make confd get 
the service information of the service center. The service center opens the 
following interfaces for external calls:
 
-### **方法一:http调用**
+### **Method one: http call **
 
-服务中心开放http接口均需要添加租户头部信息:“X-Tenant-Name:tenantName”,tenameName为租户名,默认为default,例如"X-Tenant-Name:default"。
+The service provider open http interface needs to add the tenant header 
information: "X-Tenant-Name:tenantName", and the tenameName is the tenant name. 
The default is default, for example, "X-Tenant-Name: default".
 
-* 检查服务中心健康状态
+* Check the health status of the service center
 
-  ```
-   GET 127.0.0.1:30100/health
-  ```
+  ```
+   GET 127.0.0.1:30100/health
+  ```
 
-* 获取所有微服务信息
+* Get all micro service information
 
-  ```
-   GET 127.0.0.1:30100/registry/v3/microservices
-  ```
+  ```
+   GET 127.0.0.1:30100/registry/v3/microservices
+  ```
 
-* 获取指定id的微服务信息
+* Get the microservice information of the specified id
 
-> 1. 首先根据微服务信息获取serviceId
+> 1. First get the serviceId based on the microservice information
 >
->```
->GET 
127.0.0.1:30100/registry/v3/existence?type=microservice={appId}={serviceName}={version}
->```
+> ```
+> GET 
127.0.0.1:30100/registry/v3/existence?type=microservice={appId}={serviceName}={version}
+> ```
 >
-> 2. 根据上述接口返回的serviceId获取微服务完整信息
+2. 2. Obtain the microservice complete information according to the serviceId 
returned by the above interface.
 >
->GET 127.0.0.1:30100/registry/v3/microservices/{serviceId}
+> GET 127.0.0.1:30100/registry/v3/microservices/{serviceId}
 
-* 获取指定微服务的所有实例信息
+* Get all instance information for the specified microservice
 
-  ```
-   GET 127.0.0.1:30100/registry/v3/microservices/{serviceId}/instances
+  ```
+   GET 127.0.0.1:30100/registry/v3/microservices/{serviceId}/instances
 
-   需要在header中添加:"X-ConsumerId:{serviceId}"。
-  ```
+   Need to add in the header: "X-ConsumerId: {serviceId}".
+  ```
 
-* 查找微服务实例信息
+* Find micro service instance information
 
-  ```
-   GET 

[GitHub] liubao68 closed pull request #56: Edge dir translation

2018-08-29 Thread GitBox
liubao68 closed pull request #56: Edge dir translation
URL: https://github.com/apache/incubator-servicecomb-docs/pull/56
 
 
   

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/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md 
b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
old mode 100644
new mode 100755
index bda6b16..9a9212a
--- a/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
+++ b/java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
@@ -1,15 +1,15 @@
-# 使用Edge Service做边缘服务
+# Using Edge Service for Edge Services
 
-Edge Service是ServiceComb提供的JAVA网关服务。Edge 
Service作为整个微服务系统对外的接口,向最终用户提供服务,接入RESTful请求,转发给内部微服务。Edge 
Service以开发框架的形式提供,开发者可以非常简单的搭建一个Edge Service服务,通过简单的配置就可以定义路由转发规则。同时Edge 
Service支持强大的扩展能力,服务映射、请求解析、加密解密、鉴权等逻辑都可以通过扩展实现。
+Edge Service is the JAVA gateway service provided by ServiceComb. As the 
external interface of the entire microservice system, the Edge Service provides 
services to end users, accesses RESTful requests, and forwards them to internal 
microservices. The Edge Service is provided in the form of a development 
framework. Developers can easily build an Edge Service service and define 
routing and forwarding rules with a simple configuration. At the same time, 
Edge Service supports powerful expansion capabilities, and services such as 
service mapping, request parsing, encryption and decryption, and authentication 
can be extended.
 
-Edge 
Service本身也是一个微服务,需遵守所有微服务开发的规则。其本身可以部署为多实例,前端使用负载均衡装置进行负载分发;也可以部署为主备,直接接入用户请求。开发者可以根据Edge
 Service承载的逻辑和业务访问量、组网情况来规划。
+The Edge Service itself is also a microservice that is subject to all 
microservice development rules. It can be deployed as a multi-instance, and the 
front-end uses a load balancing device for load distribution. It can also be 
deployed as a master and backup, and directly access user requests. Developers 
can plan according to the logic and service access and networking conditions 
carried by the Edge Service.
 
-## 开发Edge Service服务
-开发Edge Service和开发一个普通的微服务步骤差不多,开发者可以从导入[ServiceComb Edge Service 
Demo](https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/demo/demo-edge)入手。从头搭建项目包含如下几个步骤:
+## Developing Edge Service
+Developing Edge Service is similar to developing a normal microservice. 
Developers can import [ServiceComb Edge Service Demo] 
(https://github.com/apache/incubator-servicecomb-java-chassis/tree/master/demo/demo
 -edge) Start. Building a project from scratch involves the following steps:
 
-* 配置依赖关系
+* Configure dependencies
 
-在项目中加入edge-core的依赖,就可以启动Edge Service的功能。Edge 
Service在请求转发的时候,会经过处理链,因此还可以加入相关的处理链的模块的依赖,下面的实例增加的负载均衡的处理链,这个是必须的。
+By adding edge-core dependencies to your project, you can start the Edge 
Service. When the Edge Service requests forwarding, it will go through the 
processing chain, so it can also join the dependencies of the relevant 
processing chain modules. The following example adds the load balancing 
processing chain. This is a must.
 ```
 
   org.apache.servicecomb
@@ -21,9 +21,9 @@ Edge Service本身也是一个微服务,需遵守所有微服务开发的规
 
 ```
 
-* 定义启动类
+* Define the startup class
 
-和开发普通微服务一样,可以通过加载Spring的方式将服务拉起来。
+Just like developing a normal microservice, you can pull the service by 
loading Spring.
 ```
 public class EdgeMain {
   public static void main(String[] args) throws Exception {
@@ -33,9 +33,8 @@ public class EdgeMain {
 }
 ```
 
-* 增加配置文件microservie.yaml
-
-Edge 
Service本身也是一个微服务,遵循微服务查找的规则,自己也会进行注册。注意APPLICAIONT_ID与需要转发的微服务相同。在下面的配置中,指定了Edge
 Service监听的地址,处理链等信息。其中auth处理链是DEMO项目中自定义的处理链,用于实现认证。同时auth服务本身,不经过这个处理链,相当于不鉴权。
+* Increase the configuration file microservie.yaml
+The Edge Service itself is also a microservice that follows the rules of 
microservice lookup and will register itself. Note that APPLICAIONT_ID is the 
same as the microservice that needs to be forwarded. In the following 
configuration, the address that the Edge Service listens to, the processing 
chain, and so on are specified. The auth processing chain is a custom 
processing chain in the DEMO project for implementing authentication. At the 
same time, the auth service itself, without going through this processing 
chain, is equivalent to not authenticating.
 ```
 APPLICATION_ID: edge
 service_description:
@@ -55,18 +54,18 @@ servicecomb:
   auth: loadbalance
 ```
 
-## 工作流程
-Edge Service的工作流程如下,蓝色背景部分在Eventloop线程中执行,黄色背景部分:
-  * 如果工作于reactive模式,则直接在Eventloop线程执行
-  * 如果工作于线程池模式,则在线程池的线程中执行
+## work process
+The workflow of the Edge Service is as follows, the blue background part is 
executed in the Eventloop thread, and the yellow background part:
+   * If working in reactive mode, execute directly in the Eventloop thread
+   * If working in thread pool mode, execute in the thread pool thread
 

[incubator-servicecomb-docs] 04/04: update java-chassis-reference/en_US/edge/zuul.md

2018-08-29 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

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

commit 248d1fa38fe9256b8b814f5fa8843475e3a35a58
Author: DeanLee 
AuthorDate: Tue Aug 28 11:51:18 2018 +0800

update java-chassis-reference/en_US/edge/zuul.md
---
 java-chassis-reference/en_US/edge/zuul.md | 159 +++---
 1 file changed, 78 insertions(+), 81 deletions(-)

diff --git a/java-chassis-reference/en_US/edge/zuul.md 
b/java-chassis-reference/en_US/edge/zuul.md
old mode 100644
new mode 100755
index 4233f37..c9e132a
--- a/java-chassis-reference/en_US/edge/zuul.md
+++ b/java-chassis-reference/en_US/edge/zuul.md
@@ -1,134 +1,131 @@
-# 使用zuul做边缘服务
+# Using zuul for edge services
 
-## 概念阐述
+## Concept Description
 
-### API Gateway:
+### API Gateway:
 
-API Gateway是一个服务器,也可以说是进入系统的唯一节点。API Gateway封装内部系统的架构,并且提供API给各个客户端。
+The API Gateway is a server or a unique node that enters the system. The API 
Gateway encapsulates the architecture of the internal system and provides APIs 
to individual clients.
 
 ### Zuul
 
-Zuul是Netflix的基于JVM的路由器和服务器端负载均衡器,可以使用Zuul进行以下操作:
+Zuul is Netflix's JVM-based router and server-side load balancer, which can be 
used by Zuul to:
 
-* 认证
-* 洞察
-* 压力测试
-* 金丝雀测试
-* 动态路由
-* 服务迁移
-* 负载脱落
-* 安全
-* 静态相响应处理
-* 主动/被动流量管理
+* Certification
+* Insight
+* pressure test
+* Canary Test
+* Dynamic routing
+* Service migration
+* Load shedding
+* Safety
+* Static phase response processing
+* Active / passive traffic management
 
-本小节主要介绍在SpringBoot应用中使用Zuul做API 
Gateway。关于Zuul的详细功能介绍请参考文档[路由器和过滤器:Zuul](https://springcloud.cc/spring-cloud-dalston.html#_router_and_filter_zuul)。
+This section focuses on using Zuul as an API Gateway in SpringBoot 
applications. For detailed functions of Zuul, please refer to the document 
[router and filter: Zuul] 
(https://springcloud.cc/spring-cloud-dalston.html#_router_and_filter_zuul).
 
-## 场景描述
+## Scene Description
 
-Zuul做API Gateway,即建立一个Zuul 
Proxy应用,在该Proxy应用中统一定义所有的微服务访问入口,通过使用不同的前缀\(stripped\)来区分各个微服务。本小节通过建立一个ZuulProxy
 SpringBoot应用来演示Zuul的API Gateway功能。
+Zuul is the API Gateway, which is to establish a Zuul Proxy application. All 
the microservice access portals are defined in the Proxy application, and 
different microservices are distinguished by using different prefixes 
(stripped\). This section demonstrates Zuul's API Gateway functionality by 
creating a ZuulProxy SpringBoot application.
 
-## 注意事项
+## Precautions
 
-本小节介绍的ZuulProxy和ZuulServer等demo都是基于SpringBoot和ServiceComb框架的应用,具体请参考[在Spring 
Boot中使用java chassis](/using-java-chassis-in-spring-boot.md)。
+The demos such as ZuulProxy and ZuulServer described in this section are based 
on SpringBoot and ServiceComb frameworks. For details, please refer to [using 
java chassis in Spring Boot] (/using-java-chassis-in-spring-boot.md).
 
-## 启动Zuul Proxy
+## Launching Zuul Proxy
 
-本节介绍如何启动一个zuul proxy应用作为API Gateway。步骤如下:
+This section describes how to launch a zuul proxy application as an API 
Gateway. Proceed as follows:
 
-* **步骤 1**在pom文件中添加依赖:
+* **Step 1**Add a dependency to the pom file:
 
 ```xml
- 
-  org.springframework.cloud  
-  spring-cloud-starter-zuul 
+
+  org.springframework.cloud
+  spring-cloud-starter-zuul
 
- 
-  org.springframework.cloud  
-  spring-cloud-starter-ribbon 
- 
-  org.springframework.cloud  
-  spring-cloud-starter-hystrix 
+
+  org.springframework.cloud
+  spring-cloud-starter-ribbon
+
+  org.springframework.cloud
+  spring-cloud-starter-hystrix
 
- 
-  org.apache.servicecomb  
-  spring-boot-starter-discovery 
+
+  org.apache.servicecomb
+  spring-boot-starter-discovery
 
 ```
 
-* **步骤 2**在SpringBoot主类添加注解:
+* **Step 2**Add annotations to the SpringBoot main class:
 
 ```java
 @SpringBootApplication
 @EnableServiceComb
-@EnableZuulProxy//新增注解
+@EnableZuulProxy//Additional annotations
 public class ZuulMain{
-public static void main(String[] args) throws Exception{
-  SpringApplication.run(ZuulMain.class, args);
-}
+public static void main(String[] args) throws Exception{
+SpringApplication.run(ZuulMain.class, args);
+}
 }
 ```
 
-* **步骤 3**在application.yml文件中定义路由策略:
+* **Step 3** Define the routing policy in the application.yml file:
 
 ```yaml
-server: 
-  port: 8754 #api gateway服务端口
-zuul: 
-  routes: #路由策略
-discoveryServer: /myServer/** #路由规则
+server:
+  port: 8754 #api gateway service port
+zuul:
+  routes: #route strategy
+discoveryServer: /myServer/** #route rule
 ```
 
-红色的配置项表示可以根据实际开发环境进行配置。关于zuul.routers的路由策略的详细定义规则,请参考官方文献:[路由器和过滤器:Zuul](https://springcloud.cc/spring-cloud-dalston.html#_router_and_filter_zuul),可更细粒度地对路由进行控制。
+The red configuration item indicates that it can be configured according to 
the actual development environment. For detailed definition rules of the 
routing policy of zuul.routers, please refer to the official literature: 
[router and filter: Zuul] 

[incubator-servicecomb-docs] branch master updated (58b0b94 -> 248d1fa)

2018-08-29 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

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


from 58b0b94  saga docs fix issue (#58)
 new fed7abd  update java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
 new b3d9721  update java-chassis-reference/en_US/edge/nginx.md
 new ab9bd54  update java-chassis-reference/en_US/edge/open-service.md
 new 248d1fa  update java-chassis-reference/en_US/edge/zuul.md

The 4 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:
 .../en_US/edge/by-servicecomb-sdk.md   | 230 ++---
 java-chassis-reference/en_US/edge/nginx.md | 121 ++-
 java-chassis-reference/en_US/edge/open-service.md  |   6 +-
 java-chassis-reference/en_US/edge/zuul.md  | 159 +++---
 4 files changed, 255 insertions(+), 261 deletions(-)
 mode change 100644 => 100755 
java-chassis-reference/en_US/edge/by-servicecomb-sdk.md
 mode change 100644 => 100755 java-chassis-reference/en_US/edge/nginx.md
 mode change 100644 => 100755 java-chassis-reference/en_US/edge/open-service.md
 mode change 100644 => 100755 java-chassis-reference/en_US/edge/zuul.md



[incubator-servicecomb-docs] 03/04: update java-chassis-reference/en_US/edge/open-service.md

2018-08-29 Thread liubao
This is an automated email from the ASF dual-hosted git repository.

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

commit ab9bd54ca22b4c765a837cba38dd67f6f759af28
Author: DeanLee 
AuthorDate: Tue Aug 28 11:51:09 2018 +0800

update java-chassis-reference/en_US/edge/open-service.md
---
 java-chassis-reference/en_US/edge/open-service.md | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/java-chassis-reference/en_US/edge/open-service.md 
b/java-chassis-reference/en_US/edge/open-service.md
old mode 100644
new mode 100755
index e406c8c..c9af84e
--- a/java-chassis-reference/en_US/edge/open-service.md
+++ b/java-chassis-reference/en_US/edge/open-service.md
@@ -1,5 +1,5 @@
-# 服务能力开放
+# Open service capacity
 
-大量的微服务能力需要通过网关开放给用户、其他外部系统访问。网关一方面扮演着汇集用户请求的作用,同时还会扮演认证、鉴权、流量控制、防攻击的用途。同时,由于网关是一个汇聚点,容易形成业务的瓶颈,通常还会采用多级网关机制,最外层的网关提供主备以及简单的请求转发功能,中间层的实现鉴权等功能,多实例部署。常见的可以用于网关的技术和服务包括LVS、Nginx、Zuul等。
+A large number of micro-service capabilities need to be opened to users and 
other external systems through the gateway. On the one hand, the gateway plays 
the role of collecting user requests, and also plays the role of 
authentication, authentication, flow control, and anti-attack. At the same 
time, because the gateway is a convergence point, it is easy to form a 
bottleneck of the service. Usually, a multi-level gateway mechanism is adopted. 
The external gateway provides the master and b [...]
 
-ServiceComb 也提供了自己的网关服务Edge Service。Edge 
Service内建了强大的路由策略,支持接口级别的兼容性转发(灰度发布),内嵌ServiceComb治理能力,并支持非常灵活的扩展机制。
+ServiceComb also provides its gateway service, Edge Service. The Edge Service 
has built-in powerful routing policies, supports interface-level compatibility 
forwarding (grayscale publishing), embedded ServiceComb governance 
capabilities, and supports very flexible extension mechanisms.



[GitHub] coveralls edited a comment on issue #432: SCB-869 SC cli tool

2018-08-29 Thread GitBox
coveralls edited a comment on issue #432: SCB-869 SC cli tool
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/432#issuecomment-416609157
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18730664/badge)](https://coveralls.io/builds/18730664)
   
   Coverage increased (+0.04%) to 72.12% when pulling 
**cb792076d50b78b96e46f871d9d22a3e45d33ca4 on little-cui:cli** into 
**3de5d25f55a9df17b6509dbcd66a8e4c409f9fc8 on apache:master**.
   


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


With regards,
Apache Git Services


[GitHub] codecov-io edited a comment on issue #432: SCB-869 SC cli tool

2018-08-29 Thread GitBox
codecov-io edited a comment on issue #432: SCB-869 SC cli tool
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/432#issuecomment-416609024
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=h1)
 Report
   > Merging 
[#432](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/3de5d25f55a9df17b6509dbcd66a8e4c409f9fc8?src=pr=desc)
 will **increase** coverage by `0.02%`.
   > The diff coverage is `100%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #432  +/-   ##
   ==
   + Coverage   69.23%   69.25%   +0.02% 
   ==
 Files 139  139  
 Lines   1076810773   +5 
   ==
   + Hits 7455 7461   +6 
 Misses   2835 2835  
   + Partials  478  477   -1
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[pkg/util/sys.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-cGtnL3V0aWwvc3lzLmdv)
 | `93.1% <100%> (+1.43%)` | :arrow_up: |
   | 
[server/service/notification/stream.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-c2VydmVyL3NlcnZpY2Uvbm90aWZpY2F0aW9uL3N0cmVhbS5nbw==)
 | `65.21% <0%> (-4.35%)` | :arrow_down: |
   | 
[server/broker/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci91dGlsLmdv)
 | `53.2% <0%> (-0.27%)` | :arrow_down: |
   | 
[server/broker/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-c2VydmVyL2Jyb2tlci9zZXJ2aWNlLmdv)
 | `57.94% <0%> (+0.15%)` | :arrow_up: |
   | 
[server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv)
 | `73.66% <0%> (+0.33%)` | :arrow_up: |
   | 
[pkg/tlsutil/tlsutil.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432/diff?src=pr=tree#diff-cGtnL3Rsc3V0aWwvdGxzdXRpbC5nbw==)
 | `74.52% <0%> (+0.94%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=footer).
 Last update 
[3de5d25...cb79207](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/432?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[incubator-servicecomb-service-center] branch master updated: SCB-797 More information in dump API (#434)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 3de5d25  SCB-797 More information in dump API (#434)
3de5d25 is described below

commit 3de5d25f55a9df17b6509dbcd66a8e4c409f9fc8
Author: little-cui 
AuthorDate: Wed Aug 29 21:55:47 2018 +0800

SCB-797 More information in dump API (#434)
---
 etc/conf/app.conf|  9 -
 server/admin/model/dump.go   |  2 +-
 server/admin/service.go  | 10 +-
 server/core/config.go| 29 +
 server/core/core.go  | 36 ++--
 server/core/microservice.go  |  3 ++-
 server/core/microservice_test.go |  6 +++---
 server/core/proto/services.go| 10 +-
 server/core/swagger/v4.yaml  |  8 +++-
 version/version.go   | 40 +++-
 10 files changed, 93 insertions(+), 60 deletions(-)

diff --git a/etc/conf/app.conf b/etc/conf/app.conf
index 16fe484..f48935a 100644
--- a/etc/conf/app.conf
+++ b/etc/conf/app.conf
@@ -36,8 +36,10 @@ read_header_timeout = 60s
 read_timeout = 60s
 idle_timeout = 60s
 write_timeout = 60s
-max_header_bytes = 32768 # 32K
-max_body_bytes = 2097152 # 2M
+# 32K
+max_header_bytes = 32768
+# 2M
+max_body_bytes = 2097152
 
 enable_pprof = 0
 
@@ -65,9 +67,6 @@ manager_cluster = "127.0.0.1:2379"
 # default 30s if value less then 0
 auto_sync_interval = 30s
 
-# bootstrap time out of registry
-connect_timeout = 10s
-
 # request registry time out
 registry_timeout = 30s
 
diff --git a/server/admin/model/dump.go b/server/admin/model/dump.go
index 8c9ea87..3354d7c 100644
--- a/server/admin/model/dump.go
+++ b/server/admin/model/dump.go
@@ -183,7 +183,7 @@ type DumpRequest struct {
 type DumpResponse struct {
Response *pb.Response`json:"response,omitempty"`
Info *version.VersionSet `json:"info,omitempty"`
-   Config   *pb.ServerConfig`json:"config,omitempty"`
+   Config   map[string]string   `json:"config,omitempty"`
Environments map[string]string   `json:"environments,omitempty"`
Cache*Cache  `json:"cache,omitempty"`
 }
diff --git a/server/admin/service.go b/server/admin/service.go
index 82322ef..91689b2 100644
--- a/server/admin/service.go
+++ b/server/admin/service.go
@@ -25,6 +25,7 @@ import (
pb 
"github.com/apache/incubator-servicecomb-service-center/server/core/proto"
scerr 
"github.com/apache/incubator-servicecomb-service-center/server/error"
"github.com/apache/incubator-servicecomb-service-center/version"
+   "github.com/astaxie/beego"
"golang.org/x/net/context"
"os"
"strings"
@@ -32,6 +33,7 @@ import (
 
 var (
AdminServiceAPI = {}
+   configs map[string]string
environments= make(map[string]string)
 )
 
@@ -40,6 +42,12 @@ func init() {
arr := strings.Split(kv, "=")
environments[arr[0]] = arr[1]
}
+   configs, _ = beego.AppConfig.GetSection("default")
+   if section, err := beego.AppConfig.GetSection(beego.BConfig.RunMode); 
err == nil {
+   for k, v := range section {
+   configs[k] = v
+   }
+   }
 }
 
 type AdminService struct {
@@ -61,7 +69,7 @@ func (service *AdminService) Dump(ctx context.Context, in 
*model.DumpRequest) (*
return {
Response: pb.CreateResponse(pb.Response_SUCCESS, "Admin 
dump successfully"),
Info: version.Ver(),
-   Config:   ,
+   Config:   configs,
Environments: environments,
Cache:,
}, nil
diff --git a/server/core/config.go b/server/core/config.go
index 1715117..33876e7 100644
--- a/server/core/config.go
+++ b/server/core/config.go
@@ -17,8 +17,13 @@
 package core
 
 import (
+   "github.com/apache/incubator-servicecomb-service-center/pkg/log"
+   "github.com/apache/incubator-servicecomb-service-center/pkg/plugin"
pb 
"github.com/apache/incubator-servicecomb-service-center/server/core/proto"
+   "github.com/apache/incubator-servicecomb-service-center/version"
"github.com/astaxie/beego"
+   "os"
+   "runtime"
 )
 
 const (
@@ -28,7 +33,15 @@ const (
 var ServerInfo = new(pb.ServerInformation)
 
 func Configure() {
+   setCPUs()
+
*ServerInfo = newInfo()
+
+   plugin.SetPluginDir(ServerInfo.Config.PluginsDir)
+
+   initLogger()
+
+   version.Ver().Log()
 }
 
 func newInfo() pb.ServerInformation {
@@ -80,3 +93,19 @@ func newInfo() pb.ServerInformation {
},
}
 }
+
+func setCPUs() {
+   cores := runtime.NumCPU()
+   

[GitHub] little-cui closed pull request #434: SCB-797 More information in dump API

2018-08-29 Thread GitBox
little-cui closed pull request #434: SCB-797 More information in dump API
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/434
 
 
   

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/etc/conf/app.conf b/etc/conf/app.conf
index 16fe4842..f48935af 100644
--- a/etc/conf/app.conf
+++ b/etc/conf/app.conf
@@ -36,8 +36,10 @@ read_header_timeout = 60s
 read_timeout = 60s
 idle_timeout = 60s
 write_timeout = 60s
-max_header_bytes = 32768 # 32K
-max_body_bytes = 2097152 # 2M
+# 32K
+max_header_bytes = 32768
+# 2M
+max_body_bytes = 2097152
 
 enable_pprof = 0
 
@@ -65,9 +67,6 @@ manager_cluster = "127.0.0.1:2379"
 # default 30s if value less then 0
 auto_sync_interval = 30s
 
-# bootstrap time out of registry
-connect_timeout = 10s
-
 # request registry time out
 registry_timeout = 30s
 
diff --git a/server/admin/model/dump.go b/server/admin/model/dump.go
index 8c9ea878..3354d7c6 100644
--- a/server/admin/model/dump.go
+++ b/server/admin/model/dump.go
@@ -183,7 +183,7 @@ type DumpRequest struct {
 type DumpResponse struct {
Response *pb.Response`json:"response,omitempty"`
Info *version.VersionSet `json:"info,omitempty"`
-   Config   *pb.ServerConfig`json:"config,omitempty"`
+   Config   map[string]string   `json:"config,omitempty"`
Environments map[string]string   `json:"environments,omitempty"`
Cache*Cache  `json:"cache,omitempty"`
 }
diff --git a/server/admin/service.go b/server/admin/service.go
index 82322ef9..91689b21 100644
--- a/server/admin/service.go
+++ b/server/admin/service.go
@@ -25,6 +25,7 @@ import (
pb 
"github.com/apache/incubator-servicecomb-service-center/server/core/proto"
scerr 
"github.com/apache/incubator-servicecomb-service-center/server/error"
"github.com/apache/incubator-servicecomb-service-center/version"
+   "github.com/astaxie/beego"
"golang.org/x/net/context"
"os"
"strings"
@@ -32,6 +33,7 @@ import (
 
 var (
AdminServiceAPI = {}
+   configs map[string]string
environments= make(map[string]string)
 )
 
@@ -40,6 +42,12 @@ func init() {
arr := strings.Split(kv, "=")
environments[arr[0]] = arr[1]
}
+   configs, _ = beego.AppConfig.GetSection("default")
+   if section, err := beego.AppConfig.GetSection(beego.BConfig.RunMode); 
err == nil {
+   for k, v := range section {
+   configs[k] = v
+   }
+   }
 }
 
 type AdminService struct {
@@ -61,7 +69,7 @@ func (service *AdminService) Dump(ctx context.Context, in 
*model.DumpRequest) (*
return {
Response: pb.CreateResponse(pb.Response_SUCCESS, "Admin 
dump successfully"),
Info: version.Ver(),
-   Config:   ,
+   Config:   configs,
Environments: environments,
Cache:,
}, nil
diff --git a/server/core/config.go b/server/core/config.go
index 17151179..33876e7e 100644
--- a/server/core/config.go
+++ b/server/core/config.go
@@ -17,8 +17,13 @@
 package core
 
 import (
+   "github.com/apache/incubator-servicecomb-service-center/pkg/log"
+   "github.com/apache/incubator-servicecomb-service-center/pkg/plugin"
pb 
"github.com/apache/incubator-servicecomb-service-center/server/core/proto"
+   "github.com/apache/incubator-servicecomb-service-center/version"
"github.com/astaxie/beego"
+   "os"
+   "runtime"
 )
 
 const (
@@ -28,7 +33,15 @@ const (
 var ServerInfo = new(pb.ServerInformation)
 
 func Configure() {
+   setCPUs()
+
*ServerInfo = newInfo()
+
+   plugin.SetPluginDir(ServerInfo.Config.PluginsDir)
+
+   initLogger()
+
+   version.Ver().Log()
 }
 
 func newInfo() pb.ServerInformation {
@@ -80,3 +93,19 @@ func newInfo() pb.ServerInformation {
},
}
 }
+
+func setCPUs() {
+   cores := runtime.NumCPU()
+   runtime.GOMAXPROCS(cores)
+   log.Infof("service center is running simultaneously with %d CPU cores", 
cores)
+}
+
+func initLogger() {
+   log.SetGlobal(log.Config{
+   LoggerLevel:ServerInfo.Config.LogLevel,
+   LoggerFile: os.ExpandEnv(ServerInfo.Config.LogFilePath),
+   LogFormatText:  ServerInfo.Config.LogFormat == "text",
+   LogRotateSize:  int(ServerInfo.Config.LogRotateSize),
+   LogBackupCount: int(ServerInfo.Config.LogBackupCount),
+   })
+}
diff --git a/server/core/core.go b/server/core/core.go
index 1b6bf98c..a2aee9a9 100644
--- a/server/core/core.go
+++ b/server/core/core.go
@@ -19,14 +19,11 @@ package core
 
 import (
 

[GitHub] coveralls commented on issue #434: SCB-797 More information in dump API

2018-08-29 Thread GitBox
coveralls commented on issue #434: SCB-797 More information in dump API
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/434#issuecomment-416962266
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18729801/badge)](https://coveralls.io/builds/18729801)
   
   Coverage increased (+0.02%) to 72.127% when pulling 
**3b3923c1cd20ea06134a6069663b73d3761d4efd on little-cui:admin** into 
**7cf1790796dee1b79504528b474ff1c56b3501bc on apache:master**.
   


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


With regards,
Apache Git Services


[GitHub] codecov-io commented on issue #434: SCB-797 More information in dump API

2018-08-29 Thread GitBox
codecov-io commented on issue #434: SCB-797 More information in dump API
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/434#issuecomment-416962314
 
 
   # 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=h1)
 Report
   > Merging 
[#434](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=desc)
 into 
[master](https://codecov.io/gh/apache/incubator-servicecomb-service-center/commit/7cf1790796dee1b79504528b474ff1c56b3501bc?src=pr=desc)
 will **increase** coverage by `0.02%`.
   > The diff coverage is `13.04%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/graphs/tree.svg?width=650=GAaF7zrg8R=150=pr)](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=tree)
   
   ```diff
   @@Coverage Diff @@
   ##   master #434  +/-   ##
   ==
   + Coverage   69.22%   69.24%   +0.02% 
   ==
 Files 139  139  
 Lines   1077010768   -2 
   ==
   + Hits 7455 7456   +1 
   + Misses   2839 2835   -4 
   - Partials  476  477   +1
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=tree)
 | Coverage Δ | |
   |---|---|---|
   | 
[server/core/core.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvY29yZS5nbw==)
 | `0% <0%> (ø)` | :arrow_up: |
   | 
[server/core/config.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvY29uZmlnLmdv)
 | `0% <0%> (ø)` | :arrow_up: |
   | 
[server/core/microservice.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-c2VydmVyL2NvcmUvbWljcm9zZXJ2aWNlLmdv)
 | `76% <100%> (ø)` | :arrow_up: |
   | 
[server/admin/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-c2VydmVyL2FkbWluL3NlcnZpY2UuZ28=)
 | `84.21% <40%> (-6.97%)` | :arrow_down: |
   | 
[pkg/util/util.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-cGtnL3V0aWwvdXRpbC5nbw==)
 | `66.21% <0%> (-1.36%)` | :arrow_down: |
   | 
[server/govern/service.go](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434/diff?src=pr=tree#diff-c2VydmVyL2dvdmVybi9zZXJ2aWNlLmdv)
 | `73.66% <0%> (+0.33%)` | :arrow_up: |
   
   --
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=continue).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute  (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=footer).
 Last update 
[7cf1790...3b3923c](https://codecov.io/gh/apache/incubator-servicecomb-service-center/pull/434?src=pr=lastupdated).
 Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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


With regards,
Apache Git Services


[GitHub] little-cui opened a new pull request #434: SCB-797 More information in dump API

2018-08-29 Thread GitBox
little-cui opened a new pull request #434: SCB-797 More information in dump API
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/434
 
 
   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 `go build` `go test` `go fmt` `go vet` 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] little-cui opened a new pull request #433: SCB-850 Support discover instances from kubernetes cluster

2018-08-29 Thread GitBox
little-cui opened a new pull request #433: SCB-850 Support discover instances 
from kubernetes cluster
URL: https://github.com/apache/incubator-servicecomb-service-center/pull/433
 
 
   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 `go build` `go test` `go fmt` `go vet` 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] little-cui commented on issue #432: SCB-869 SC cli tool

2018-08-29 Thread GitBox
little-cui commented on issue #432: SCB-869 SC cli tool
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/432#issuecomment-416921776
 
 
   plz do not merge it, i will add the readme for this feature later


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] imlidian commented on issue #48: Introduction dir translation

2018-08-29 Thread GitBox
imlidian commented on issue #48: Introduction dir translation
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/48#issuecomment-416916569
 
 
   all done


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


With regards,
Apache Git Services


[GitHub] coveralls commented on issue #280: SCB-879 Added the aspectjweaver.jar into the docker image with perf profile

2018-08-29 Thread GitBox
coveralls commented on issue #280: SCB-879 Added the aspectjweaver.jar into the 
docker image with perf profile
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/280#issuecomment-416900673
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18725907/badge)](https://coveralls.io/builds/18725907)
   
   Coverage remained the same at 93.687% when pulling 
**57c4ff1da30e4122ab0d3626e9d7e1f919673cce on SCB-879** into 
**aa7cb9d59b297c5de934c09dd7d93fd751c0c187 on 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] imlidian commented on issue #43: Migration build-provider from web repo

2018-08-29 Thread GitBox
imlidian commented on issue #43: Migration build-provider from web repo
URL: 
https://github.com/apache/incubator-servicecomb-docs/pull/43#issuecomment-416900501
 
 
   all done


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


With regards,
Apache Git Services


[incubator-servicecomb-saga] branch master updated: Update the ROADMAP.md

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 664b7e7  Update the ROADMAP.md
664b7e7 is described below

commit 664b7e7db7baa7a491855a965f469a60d75b52f8
Author: Willem Jiang 
AuthorDate: Wed Aug 29 18:07:17 2018 +0800

Update the ROADMAP.md
---
 ROADMAP.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ROADMAP.md b/ROADMAP.md
index 42ecfe6..f33cbe9 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -6,6 +6,8 @@
 ## Saga
 - [*] [SCB-665](https://issues.apache.org/jira/browse/SCB-665) Support TCC 
(epic)
 - [] [SCB-16](https://issues.apache.org/jira/browse/SCB-16) Using MQ to 
increase the availability (epic)
+- [] [SCB-878](https://issues.apache.org/jira/browse/SCB-878) Pack Performance 
Tuning (epic)
+
 
 ### DEMO
 - [*] [SCB-244](https://issues.apache.org/jira/browse/SCB-244) Add demo to use 
pack with Java-Chassis (new++)



[GitHub] WillemJiang closed pull request #280: SCB-879 Added the aspectjweaver.jar into the docker image with perf profile

2018-08-29 Thread GitBox
WillemJiang closed pull request #280: SCB-879 Added the aspectjweaver.jar into 
the docker image with perf profile
URL: https://github.com/apache/incubator-servicecomb-saga/pull/280
 
 
   


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


With regards,
Apache Git Services


[incubator-servicecomb-saga] branch master updated: SCB-879 Added the aspectjweaver.jar into the docker image when using pref profile

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 7bd029a  SCB-879 Added the aspectjweaver.jar into the docker image 
when using pref profile
7bd029a is described below

commit 7bd029afc7b7f0325e6da3eddb4c00ce40389c8d
Author: Willem Jiang 
AuthorDate: Wed Aug 29 17:49:16 2018 +0800

SCB-879 Added the aspectjweaver.jar into the docker image when using pref 
profile
---
 alpha/alpha-server/pom.xml | 32 
 saga-spring/pom.xml| 32 
 2 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml
index e26bbcb..2a6856a 100644
--- a/alpha/alpha-server/pom.xml
+++ b/alpha/alpha-server/pom.xml
@@ -231,14 +231,38 @@
   kamon-statsd_2.12
 
 
-  io.kamon
-  kamon-autoweave_2.12
-
-
   org.aspectj
   aspectjweaver
 
   
+  
+  
+
+  
+org.apache.maven.plugins
+maven-dependency-plugin
+
+  
+aspectj.copy
+process-test-resources
+
+  copy
+
+
+  
+
+  org.aspectj
+  aspectjweaver
+
+  
+  
${project.build.directory}/saga
+  true
+
+  
+
+  
+
+  
 
   
 
diff --git a/saga-spring/pom.xml b/saga-spring/pom.xml
index b996e23..cb71175 100755
--- a/saga-spring/pom.xml
+++ b/saga-spring/pom.xml
@@ -218,14 +218,38 @@
   kamon-statsd_2.12
 
 
-  io.kamon
-  kamon-autoweave_2.12
-
-
   org.aspectj
   aspectjweaver
 
   
+  
+  
+
+  
+org.apache.maven.plugins
+maven-dependency-plugin
+
+  
+aspectj.copy
+process-test-resources
+
+  copy
+
+
+  
+
+  org.aspectj
+  aspectjweaver
+
+  
+  
${project.build.directory}/saga
+  true
+
+  
+
+  
+
+  
 
   
 



[GitHub] WillemJiang opened a new pull request #280: SCB-879 Added the aspectjweaver.jar into the docker image with perf profile

2018-08-29 Thread GitBox
WillemJiang opened a new pull request #280: SCB-879 Added the aspectjweaver.jar 
into the docker image with perf profile
URL: https://github.com/apache/incubator-servicecomb-saga/pull/280
 
 
   


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


With regards,
Apache Git Services


[incubator-servicecomb-saga] branch master updated (b44697c -> aa7cb9d)

2018-08-29 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 b44697c  SCB-875: Start the old saga demo with sh script (#279)
 new 56522d1  SCB-868 Added Segment to the Alpha Server
 new aa7cb9d  SCB-875 Added the +x properties on the script file

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:
 .../servicecomb/saga/alpha/core/TxConsistentService.java  |  7 ++-
 .../saga/alpha/server/GrpcTxEventEndpointImpl.java|  2 +-
 .../saga/alpha/server/SpringCommandRepository.java|  8 
 .../saga/alpha/server/SpringTxEventRepository.java| 11 +++
 .../saga/alpha/server/SpringTxTimeoutRepository.java  |  9 -
 saga-demo/conditional-transaction-demo/README.md  |  7 +--
 .../conditional-transaction-demo.sh   |  0
 saga-demo/dependency-free-transaction-demo/README.md  |  8 +---
 .../dependency-free-transaction-demo.sh   |  0
 saga-demo/saga-dubbo-demo/README.md   |  9 ++---
 10 files changed, 38 insertions(+), 23 deletions(-)
 mode change 100644 => 100755 
saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
 mode change 100644 => 100755 
saga-demo/dependency-free-transaction-demo/dependency-free-transaction-demo.sh



[incubator-servicecomb-saga] 02/02: SCB-875 Added the +x properties on the script file

2018-08-29 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 aa7cb9d59b297c5de934c09dd7d93fd751c0c187
Author: Willem Jiang 
AuthorDate: Wed Aug 29 16:58:20 2018 +0800

SCB-875 Added the +x properties on the script file
---
 saga-demo/conditional-transaction-demo/README.md | 7 +--
 .../conditional-transaction-demo/conditional-transaction-demo.sh | 0
 saga-demo/dependency-free-transaction-demo/README.md | 8 +---
 .../dependency-free-transaction-demo.sh  | 0
 saga-demo/saga-dubbo-demo/README.md  | 9 ++---
 5 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/saga-demo/conditional-transaction-demo/README.md 
b/saga-demo/conditional-transaction-demo/README.md
index 2f8ce61..4e62c8e 100755
--- a/saga-demo/conditional-transaction-demo/README.md
+++ b/saga-demo/conditional-transaction-demo/README.md
@@ -42,12 +42,7 @@ when the recovery policy if backward recovery.
mvn package -DskipTests -Pdocker -Pdemo
```
 
-2. start application up in saga/saga-demo/conditional-transaction-demo with 
the following command
-```
-chmod +x conditional-transaction-demo.sh
-./conditional-transaction-demo.sh up
-```
-3. stop application
+2. stop application
```
./conditional-transaction-demo.sh down
```
diff --git 
a/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh 
b/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
old mode 100644
new mode 100755
diff --git a/saga-demo/dependency-free-transaction-demo/README.md 
b/saga-demo/dependency-free-transaction-demo/README.md
index 9c72e0e..c6c5f6a 100755
--- a/saga-demo/dependency-free-transaction-demo/README.md
+++ b/saga-demo/dependency-free-transaction-demo/README.md
@@ -28,13 +28,7 @@ User ---> Saga -> flight booking service
```
mvn package -DskipTests -Pdocker -Pdemo
```
-
-2. start application up in saga/saga-demo/dependency-free-transaction-demo 
with the following command
-```
-chmod +x dependency-free-transaction-demo.sh
-./dependency-free-transaction-demo.sh up
-```
-3. stop application
+2. stop application
```
./dependency-free-transaction-demo.sh down
```
diff --git 
a/saga-demo/dependency-free-transaction-demo/dependency-free-transaction-demo.sh
 
b/saga-demo/dependency-free-transaction-demo/dependency-free-transaction-demo.sh
old mode 100644
new mode 100755
diff --git a/saga-demo/saga-dubbo-demo/README.md 
b/saga-demo/saga-dubbo-demo/README.md
index f8641d8..53e9059 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -19,12 +19,7 @@ You will need:
```
mvn clean install -DskipTests -Pdocker -Pdemo
```
-2. Enter the saga dubbo demo directory and give permissions to script
-   ```
-   cd ./saga-demo/saga-dubbo-demo
-   chmod +x saga-dubbo-demo.sh
-   ```
-3. start the whole application up(including alpha server and three demo 
services)
+2. start the whole application up(including alpha server and three demo 
services)
```
./saga-dubbo-demo.sh up
```
@@ -99,4 +94,4 @@ A->B B->C (C throw an exception)
 ```
 
 ## Debugging
-Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
\ No newline at end of file
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.



[incubator-servicecomb-saga] 01/02: SCB-868 Added Segment to the Alpha Server

2018-08-29 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 56522d1ce7b49f13a30507536069a16db56b2cff
Author: Willem Jiang 
AuthorDate: Wed Aug 29 16:47:10 2018 +0800

SCB-868 Added Segment to the Alpha Server
---
 .../servicecomb/saga/alpha/core/TxConsistentService.java  |  7 ++-
 .../saga/alpha/server/GrpcTxEventEndpointImpl.java|  2 +-
 .../saga/alpha/server/SpringCommandRepository.java|  8 
 .../saga/alpha/server/SpringTxEventRepository.java| 11 +++
 .../saga/alpha/server/SpringTxTimeoutRepository.java  |  9 -
 5 files changed, 34 insertions(+), 3 deletions(-)

diff --git 
a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxConsistentService.java
 
b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxConsistentService.java
index 9a7f82b..ad08440 100644
--- 
a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxConsistentService.java
+++ 
b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/TxConsistentService.java
@@ -28,6 +28,10 @@ import java.util.List;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import kamon.annotation.EnableKamon;
+import kamon.annotation.Segment;
+
+@EnableKamon
 public class TxConsistentService {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -38,7 +42,7 @@ public class TxConsistentService {
   public TxConsistentService(TxEventRepository eventRepository) {
 this.eventRepository = eventRepository;
   }
-
+  @Segment(name = "handleTxEvent", category = "application", library = "kamon")
   public boolean handle(TxEvent event) {
 if (types.contains(event.type()) && isGlobalTxAborted(event)) {
   LOG.info("Transaction event {} rejected, because its parent with 
globalTxId {} was already aborted",
@@ -51,6 +55,7 @@ public class TxConsistentService {
 return true;
   }
 
+  @Segment(name = "isGlobalTxAborted", category = "application", library = 
"kamon")
   private boolean isGlobalTxAborted(TxEvent event) {
 return !eventRepository.findTransactions(event.globalTxId(), 
TxAbortedEvent.name()).isEmpty();
   }
diff --git 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/GrpcTxEventEndpointImpl.java
 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/GrpcTxEventEndpointImpl.java
index 04e017d..677fa87 100644
--- 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/GrpcTxEventEndpointImpl.java
+++ 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/GrpcTxEventEndpointImpl.java
@@ -79,7 +79,7 @@ class GrpcTxEventEndpointImpl extends TxEventServiceImplBase {
   }
 
   @Override
-  @Trace("ontransactionEvent")
+  @Trace("onTransactionEvent")
   public void onTxEvent(GrpcTxEvent message, StreamObserver 
responseObserver) {
 boolean ok = txConsistentService.handle(new TxEvent(
 message.getServiceName(),
diff --git 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/SpringCommandRepository.java
 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/SpringCommandRepository.java
index 4aa30d1..f7078c2 100644
--- 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/SpringCommandRepository.java
+++ 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/SpringCommandRepository.java
@@ -34,6 +34,10 @@ import org.apache.servicecomb.saga.alpha.core.TxEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import kamon.annotation.EnableKamon;
+import kamon.annotation.Segment;
+
+@EnableKamon
 public class SpringCommandRepository implements CommandRepository {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -46,6 +50,7 @@ public class SpringCommandRepository implements 
CommandRepository {
   }
 
   @Override
+  @Segment(name = "saveCompensationCommands", category = "application", 
library = "kamon")
   public void saveCompensationCommands(String globalTxId) {
 List events = eventRepository
 .findStartedEventsWithMatchingEndedButNotCompensatedEvents(globalTxId);
@@ -68,17 +73,20 @@ public class SpringCommandRepository implements 
CommandRepository {
   }
 
   @Override
+  @Segment(name = "markCommandAsDone", category = "application", library = 
"kamon")
   public void markCommandAsDone(String globalTxId, String localTxId) {
 commandRepository.updateStatusByGlobalTxIdAndLocalTxId(DONE.name(), 
globalTxId, localTxId);
   }
 
   @Override
+  @Segment(name = "findUncompletedCommands", category = "application", library 
= "kamon")
   public List findUncompletedCommands(String globalTxId) {
 return 

[incubator-servicecomb-saga] branch master updated: SCB-875: Start the old saga demo with sh script (#279)

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

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


The following commit(s) were added to refs/heads/master by this push:
 new b44697c  SCB-875: Start the old saga demo with sh script (#279)
b44697c is described below

commit b44697c0d1550140e11c0134045d3c866c4b7b93
Author: fcg <565817...@qq.com>
AuthorDate: Wed Aug 29 16:48:25 2018 +0800

SCB-875: Start the old saga demo with sh script (#279)

 SCB-875: Start the old saga demo with sh script
https://issues.apache.org/jira/browse/SCB-875
---
 saga-demo/conditional-transaction-demo/README.md   | 17 ---
 .../conditional-transaction-demo.sh| 53 ++
 .../docker-compose.yaml| 10 ++--
 .../dependency-free-transaction-demo/README.md | 17 ---
 .../dependency-free-transaction-demo.sh| 53 ++
 .../docker-compose.yaml| 12 ++---
 saga-demo/saga-servicecomb-demo/README.md  | 14 --
 .../saga-servicecomb-demo/docker-compose.yaml  |  8 ++--
 .../saga-servicecomb-demo/saga-servicecomb-demo.sh | 53 ++
 9 files changed, 207 insertions(+), 30 deletions(-)

diff --git a/saga-demo/conditional-transaction-demo/README.md 
b/saga-demo/conditional-transaction-demo/README.md
index 505a666..2f8ce61 100755
--- a/saga-demo/conditional-transaction-demo/README.md
+++ b/saga-demo/conditional-transaction-demo/README.md
@@ -38,14 +38,19 @@ when the recovery policy if backward recovery.
 
 ## Running Demo
 1. run the following command to create docker images in saga project root 
folder.
-```
-mvn package -DskipTests -Pdocker -Pdemo
-```
+   ```
+   mvn package -DskipTests -Pdocker -Pdemo
+   ```
 
 2. start application up in saga/saga-demo/conditional-transaction-demo with 
the following command
-```
-docker-compose up
-```
+```
+chmod +x conditional-transaction-demo.sh
+./conditional-transaction-demo.sh up
+```
+3. stop application
+   ```
+   ./conditional-transaction-demo.sh down
+   ```
 
 ## User Requests
 The request JSON to ensure the workflow order looks like the following:
diff --git 
a/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh 
b/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
new file mode 100644
index 000..2f0c8fe
--- /dev/null
+++ b/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+# 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.
+
+service=conditional-transaction-demo
+
+show_usage() {
+  echo "Usage: $0 {up|down}" >&2
+}
+
+fetch_version() {
+  version="$(printf 'VER\t${project.version}' | mvn help:evaluate | grep 
'^VER' | cut -f2)"
+}
+
+if [[ -z $1 ]]; then
+  show_usage
+  exit 2
+fi
+
+case $1 in
+  up)
+fetch_version
+echo "Starting ${service}:${version}"
+TAG=$version docker-compose up
+exit $?
+  ;;
+
+  down)
+fetch_version
+echo "Stopping ${service}:${version}"
+TAG=$version docker-compose down
+exit $?
+  ;;
+  
+  *)
+show_usage
+exit 2
+  ;;
+esac
+
diff --git a/saga-demo/conditional-transaction-demo/docker-compose.yaml 
b/saga-demo/conditional-transaction-demo/docker-compose.yaml
index b8b1bb6..c9eb9f4 100755
--- a/saga-demo/conditional-transaction-demo/docker-compose.yaml
+++ b/saga-demo/conditional-transaction-demo/docker-compose.yaml
@@ -34,31 +34,31 @@ services:
 retries: 5
 
   payment:
-image: "payment:0.3.0-SNAPSHOT"
+image: "payment:${TAG}"
 hostname: payment
 ports:
   - "8080"
 
   membership:
-image: "membership:0.3.0-SNAPSHOT"
+image: "membership:${TAG}"
 hostname: membership
 ports:
   - "8080"
 
   inventory:
-image: "inventory:0.3.0-SNAPSHOT"
+image: "inventory:${TAG}"
 hostname: inventory
 ports:
   - "8080"
 
   supplier:
-image: "supplier:0.3.0-SNAPSHOT"
+image: "supplier:${TAG}"
 hostname: supplier
 ports:
   - "8080"
 
   saga:
-image: "saga-spring:0.3.0-SNAPSHOT"
+image: "saga-spring:${TAG}"
 hostname: 

[GitHub] WillemJiang closed pull request #279: SCB-875: Start the old saga demo with sh script

2018-08-29 Thread GitBox
WillemJiang closed pull request #279: SCB-875: Start the old saga demo with sh 
script
URL: https://github.com/apache/incubator-servicecomb-saga/pull/279
 
 
   

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/saga-demo/conditional-transaction-demo/README.md 
b/saga-demo/conditional-transaction-demo/README.md
index 505a6667..2f8ce618 100755
--- a/saga-demo/conditional-transaction-demo/README.md
+++ b/saga-demo/conditional-transaction-demo/README.md
@@ -38,14 +38,19 @@ when the recovery policy if backward recovery.
 
 ## Running Demo
 1. run the following command to create docker images in saga project root 
folder.
-```
-mvn package -DskipTests -Pdocker -Pdemo
-```
+   ```
+   mvn package -DskipTests -Pdocker -Pdemo
+   ```
 
 2. start application up in saga/saga-demo/conditional-transaction-demo with 
the following command
-```
-docker-compose up
-```
+```
+chmod +x conditional-transaction-demo.sh
+./conditional-transaction-demo.sh up
+```
+3. stop application
+   ```
+   ./conditional-transaction-demo.sh down
+   ```
 
 ## User Requests
 The request JSON to ensure the workflow order looks like the following:
diff --git 
a/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh 
b/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
new file mode 100644
index ..2f0c8fe5
--- /dev/null
+++ b/saga-demo/conditional-transaction-demo/conditional-transaction-demo.sh
@@ -0,0 +1,53 @@
+#!/usr/bin/env bash
+
+# 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.
+
+service=conditional-transaction-demo
+
+show_usage() {
+  echo "Usage: $0 {up|down}" >&2
+}
+
+fetch_version() {
+  version="$(printf 'VER\t${project.version}' | mvn help:evaluate | grep 
'^VER' | cut -f2)"
+}
+
+if [[ -z $1 ]]; then
+  show_usage
+  exit 2
+fi
+
+case $1 in
+  up)
+fetch_version
+echo "Starting ${service}:${version}"
+TAG=$version docker-compose up
+exit $?
+  ;;
+
+  down)
+fetch_version
+echo "Stopping ${service}:${version}"
+TAG=$version docker-compose down
+exit $?
+  ;;
+  
+  *)
+show_usage
+exit 2
+  ;;
+esac
+
diff --git a/saga-demo/conditional-transaction-demo/docker-compose.yaml 
b/saga-demo/conditional-transaction-demo/docker-compose.yaml
index b8b1bb62..c9eb9f4c 100755
--- a/saga-demo/conditional-transaction-demo/docker-compose.yaml
+++ b/saga-demo/conditional-transaction-demo/docker-compose.yaml
@@ -34,31 +34,31 @@ services:
 retries: 5
 
   payment:
-image: "payment:0.3.0-SNAPSHOT"
+image: "payment:${TAG}"
 hostname: payment
 ports:
   - "8080"
 
   membership:
-image: "membership:0.3.0-SNAPSHOT"
+image: "membership:${TAG}"
 hostname: membership
 ports:
   - "8080"
 
   inventory:
-image: "inventory:0.3.0-SNAPSHOT"
+image: "inventory:${TAG}"
 hostname: inventory
 ports:
   - "8080"
 
   supplier:
-image: "supplier:0.3.0-SNAPSHOT"
+image: "supplier:${TAG}"
 hostname: supplier
 ports:
   - "8080"
 
   saga:
-image: "saga-spring:0.3.0-SNAPSHOT"
+image: "saga-spring:${TAG}"
 hostname: saga
 links:
   - "postgres:postgres.servicecomb.io"
diff --git a/saga-demo/dependency-free-transaction-demo/README.md 
b/saga-demo/dependency-free-transaction-demo/README.md
index 4fb6e0f5..9c72e0ee 100755
--- a/saga-demo/dependency-free-transaction-demo/README.md
+++ b/saga-demo/dependency-free-transaction-demo/README.md
@@ -25,14 +25,19 @@ User ---> Saga -> flight booking service
 
 ## Running Demo
 1. run the following command to create docker images in saga project root 
folder.
-```
-mvn package -DskipTests -Pdocker -Pdemo
-```
+   ```
+   mvn package -DskipTests -Pdocker -Pdemo
+   ```
 
 2. start application up in saga/saga-demo/dependency-free-transaction-demo 
with the following command
-```
-docker-compose up
-```
+```
+chmod +x dependency-free-transaction-demo.sh
+./dependency-free-transaction-demo.sh up
+```
+3. stop application
+   

[GitHub] coveralls commented on issue #279: SCB-875: Start the old saga demo with sh script

2018-08-29 Thread GitBox
coveralls commented on issue #279: SCB-875: Start the old saga demo with sh 
script
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/279#issuecomment-416872358
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18724376/badge)](https://coveralls.io/builds/18724376)
   
   Coverage increased (+0.07%) to 93.791% when pulling 
**ff7355b657a0a69588f5af09fd1974923b27263a on oliugian:master** into 
**f54e7e89fce791df8f8e3d3ed623aeb7b0d42aad 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] oliugian opened a new pull request #279: SCB-875: Start the old saga demo with sh script

2018-08-29 Thread GitBox
oliugian opened a new pull request #279: SCB-875: Start the old saga demo with 
sh script
URL: https://github.com/apache/incubator-servicecomb-saga/pull/279
 
 
   SCB-875: Start the old saga demo with sh script
   https://issues.apache.org/jira/browse/SCB-875
   


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 #884: [SCB-873] Make the validation result display the parameter name instead of arg0, arg1

2018-08-29 Thread GitBox
coveralls edited a comment on issue #884: [SCB-873] Make the validation result 
display the parameter name instead of arg0, arg1
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/884#issuecomment-416502909
 
 
   
   [![Coverage 
Status](https://coveralls.io/builds/18723039/badge)](https://coveralls.io/builds/18723039)
   
   Coverage decreased (-0.08%) to 86.101% when pulling 
**3ff251cf67cfcb474eaa078029d1fbe4f1ad002c on weichao666:validator** into 
**be33086dbde190ceec425aeea3ae5662fbf6b633 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] WillemJiang closed pull request #276: SCB-874:saga dubbo demo insert sql and readme optimization

2018-08-29 Thread GitBox
WillemJiang closed pull request #276: SCB-874:saga dubbo demo insert sql and 
readme optimization
URL: https://github.com/apache/incubator-servicecomb-saga/pull/276
 
 
   

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/saga-demo/saga-dubbo-demo/README.md 
b/saga-demo/saga-dubbo-demo/README.md
index deadb4f1..f8641d80 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -15,10 +15,88 @@ You will need:
 [alpha_server]: 
https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha
 
 ## Running Demo
-```bash
-$ mvn clean install -DskipTests -Pdocker
-$ ./saga-dubbo-demo.sh up
+1. run the following command to create docker images in saga project root 
folder.
+   ```
+   mvn clean install -DskipTests -Pdocker -Pdemo
+   ```
+2. Enter the saga dubbo demo directory and give permissions to script
+   ```
+   cd ./saga-demo/saga-dubbo-demo
+   chmod +x saga-dubbo-demo.sh
+   ```
+3. start the whole application up(including alpha server and three demo 
services)
+   ```
+   ./saga-dubbo-demo.sh up
+   ```
+**Note:** If you prefer to use MySQL as alpha's backend database, you need 
to try the following steps instead:
+1. add dependency of `mysql-connector-java` in `alpha/alpha-server/pom.xml`
+ ```xml
+ 
+   mysql
+   mysql-connector-java
+ 
+ ```
+2. re-generate saga's docker images in saga project root folder
+ ```bash
+ mvn package -DskipTests -Pdocker -Pdemo
+ ```
+3. start application up in `saga-dubbo-demo` with the following command
+ ```
+cd ./saga-demo/saga-dubbo-demo
+ ./saga-dubbo-demo.sh up-mysql
+ ```
+
+**Note:** If you want start alpha server and demon services separately, 
you can try the following steps:
+1. start alpha server
+ ```bash
+ ./saga-dubbo-demo.sh up-alpha
+ ```
+2. when alpha server started complatelly, then start the demo services
+ ```bash
+ ./saga-dubbo-demo.sh up-demo
+ ```
+4. stop application
+   ```
+   ./saga-dubbo-demo.sh down
+   ```
+
+Use browser to run transaction demos:
+A:servicea B:serviceb C:servicec
+
+A->B
+```
+ http://${host_address}:8071/serviceInvoke/Ab
+```
+
+A->B (A throw an exception)
+```
+ http://${host_address}:8071/serviceInvoke/AExceptionWhenAb
+```
+
+A->B (B throw an exception)
+```
+ http://${host_address}:8071/serviceInvoke/BExceptionWhenAb
+```
+
+A->B A->C
+```
+ http://${host_address}:8071/serviceInvoke/AbAc
+```
+
+A->B A->C (C throw an exception)
+```
+ http://${host_address}:8071/serviceInvoke/CExceptionWhenAbAc
+```
+
+A->B B->C
+```
+ http://${host_address}:8071/serviceInvoke/AbBc
+```
+
+A->B B->C (C throw an exception)
+```
+ http://${host_address}:8071/serviceInvoke/CExceptionWhenAbBc
 ```
 
 ## Debugging
-Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
\ No newline at end of file
diff --git 
a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql 
b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql
index 91fc88ac..4802838f 100644
--- a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql
@@ -15,10 +15,10 @@
  * limitations under the License.
  */
 
-CREATE TABLE `testa` (
+CREATE TABLE IF NOT EXISTS `testa` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `service` varchar(128) DEFAULT NULL,
   `vstatus` varchar(128) DEFAULT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-INSERT INTO `testa` (`id`, `service`, `vstatus`) VALUES 
('1','servicea','init');
\ No newline at end of file
+INSERT INTO testa SELECT '1','servicea','init' WHERE NOT EXISTS (SELECT 1 FROM 
testa WHERE id = '1');
\ No newline at end of file
diff --git 
a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql 
b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql
index 21c05cd5..b56018a1 100644
--- 
a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql
+++ 
b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql
@@ -23,4 +23,4 @@ CREATE TABLE IF NOT EXISTS testa (
 
 CREATE INDEX IF NOT EXISTS testa_index ON testa (id, service);
 
-INSERT INTO testa (id, service, vstatus) VALUES ('1','servicea','init');
\ No newline at end of file
+INSERT INTO testa SELECT '1','servicea','init' WHERE NOT EXISTS (SELECT 1 FROM 
testa WHERE id = '1');
\ No newline at end of file
diff --git 
a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-mysql.sql 

[GitHub] WillemJiang commented on a change in pull request #276: SCB-874:saga dubbo demo insert sql and readme optimization

2018-08-29 Thread GitBox
WillemJiang commented on a change in pull request #276: SCB-874:saga dubbo demo 
insert sql and readme optimization
URL: 
https://github.com/apache/incubator-servicecomb-saga/pull/276#discussion_r213554755
 
 

 ##
 File path: saga-demo/saga-spring-demo/README.md
 ##
 @@ -23,10 +23,14 @@ You can run the demo using either docker compose or 
executable files.
 ### via docker compose
 1. run the following command to create docker images in saga project root 
folder.
```
-   mvn clean package -DskipTests -Pdocker -Pdemo
+   mvn clean install -DskipTests -Pdocker -Pdemo
 
 Review comment:
   OK,we can keep the 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] WillemJiang closed pull request #278: SCB-856 Add onTccCoordinated grpc method for alpha server.

2018-08-29 Thread GitBox
WillemJiang closed pull request #278: SCB-856 Add onTccCoordinated grpc method 
for alpha server.
URL: https://github.com/apache/incubator-servicecomb-saga/pull/278
 
 
   

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/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
index e3b89b99..0eaf9563 100644
--- 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
+++ 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
@@ -27,6 +27,7 @@
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand;
+import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinatedEvent;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipatedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionStartedEvent;
@@ -78,6 +79,16 @@ public void 
onTccTransactionEnded(GrpcTccTransactionEndedEvent request, StreamOb
 responseObserver.onNext(tccCallbackEngine.execute(request) ? ALLOW : 
REJECT);
 responseObserver.onCompleted();
   }
+
+  @Override
+  public void onTccCoordinated(GrpcTccCoordinatedEvent request, 
StreamObserver responseObserver) {
+LOG.info("Received coordinated event, global tx: {}, local tx: {}, parent 
id: {}, "
++ "method: {}, status: {}, service [{}] instanceId [{}]",
+request.getGlobalTxId(), request.getLocalTxId(), 
request.getParentTxId(),
+request.getMethodName(), request.getStatus(), 
request.getServiceName(), request.getInstanceId());
+responseObserver.onNext(ALLOW);
+responseObserver.onCompleted();
+  }
   
   @Override
   public void onDisconnected(GrpcServiceConfig request, 
StreamObserver responseObserver) {
diff --git 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
index 2e6e1f23..68597145 100644
--- 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
+++ 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
@@ -38,6 +38,7 @@
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand;
+import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinatedEvent;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipatedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionStartedEvent;
@@ -157,6 +158,9 @@ public void assertOnTccTransactionSucceedEnded() {
 assertThat(command.getMethod(), is("confirm"));
 assertThat(command.getGlobalTxId(), is(globalTxId));
 assertThat(command.getServiceName(), is(serviceName));
+
+GrpcAck result = 
blockingStub.onTccCoordinated(newCoordinatedEvent("Succeed", "Confirm"));
+assertThat(result.getAborted(), is(false));
   }
 
   @Test
@@ -256,6 +260,18 @@ private GrpcTccTransactionEndedEvent newTxEnd(String 
status) {
 .build();
   }
 
+  private GrpcTccCoordinatedEvent newCoordinatedEvent(String status, String 
method) {
+return GrpcTccCoordinatedEvent.newBuilder()
+.setGlobalTxId(globalTxId)
+.setLocalTxId(localTxId)
+.setServiceName(serviceName)
+.setInstanceId(instanceId)
+.setMethodName(method)
+.setStatus(status)
+.build();
+  }
+
+
   private GrpcAck onReceivedCoordinateCommand(GrpcTccCoordinateCommand 
command) {
 return GrpcAck.newBuilder().setAborted(false).build();
   }


 


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


With regards,
Apache Git Services


[incubator-servicecomb-saga] branch master updated: SCB-856 Add onTccCoordinated grpc method for alpha server.

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 5b1688e  SCB-856 Add onTccCoordinated grpc method for alpha server.
5b1688e is described below

commit 5b1688e3fcdef474898c80974dd942480288b8af
Author: cherrylzhao 
AuthorDate: Wed Aug 29 11:48:15 2018 +0800

SCB-856 Add onTccCoordinated grpc method for alpha server.
---
 .../saga/alpha/server/tcc/GrpcTccEventService.java   | 11 +++
 .../saga/alpha/tcc/server/AlphaTccServerTest.java| 16 
 2 files changed, 27 insertions(+)

diff --git 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
index e3b89b9..0eaf956 100644
--- 
a/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
+++ 
b/alpha/alpha-server/src/main/java/org/apache/servicecomb/saga/alpha/server/tcc/GrpcTccEventService.java
@@ -27,6 +27,7 @@ import 
org.apache.servicecomb.saga.alpha.server.tcc.registry.TransactionEventReg
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand;
+import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinatedEvent;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipatedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionStartedEvent;
@@ -78,6 +79,16 @@ public class GrpcTccEventService extends 
TccEventServiceGrpc.TccEventServiceImpl
 responseObserver.onNext(tccCallbackEngine.execute(request) ? ALLOW : 
REJECT);
 responseObserver.onCompleted();
   }
+
+  @Override
+  public void onTccCoordinated(GrpcTccCoordinatedEvent request, 
StreamObserver responseObserver) {
+LOG.info("Received coordinated event, global tx: {}, local tx: {}, parent 
id: {}, "
++ "method: {}, status: {}, service [{}] instanceId [{}]",
+request.getGlobalTxId(), request.getLocalTxId(), 
request.getParentTxId(),
+request.getMethodName(), request.getStatus(), 
request.getServiceName(), request.getInstanceId());
+responseObserver.onNext(ALLOW);
+responseObserver.onCompleted();
+  }
   
   @Override
   public void onDisconnected(GrpcServiceConfig request, 
StreamObserver responseObserver) {
diff --git 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
index 2e6e1f2..6859714 100644
--- 
a/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
+++ 
b/alpha/alpha-server/src/test/java/org/apache/servicecomb/saga/alpha/tcc/server/AlphaTccServerTest.java
@@ -38,6 +38,7 @@ import org.apache.servicecomb.saga.common.TransactionStatus;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcAck;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcServiceConfig;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinateCommand;
+import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccCoordinatedEvent;
 import org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccParticipatedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionEndedEvent;
 import 
org.apache.servicecomb.saga.pack.contract.grpc.GrpcTccTransactionStartedEvent;
@@ -157,6 +158,9 @@ public class AlphaTccServerTest {
 assertThat(command.getMethod(), is("confirm"));
 assertThat(command.getGlobalTxId(), is(globalTxId));
 assertThat(command.getServiceName(), is(serviceName));
+
+GrpcAck result = 
blockingStub.onTccCoordinated(newCoordinatedEvent("Succeed", "Confirm"));
+assertThat(result.getAborted(), is(false));
   }
 
   @Test
@@ -256,6 +260,18 @@ public class AlphaTccServerTest {
 .build();
   }
 
+  private GrpcTccCoordinatedEvent newCoordinatedEvent(String status, String 
method) {
+return GrpcTccCoordinatedEvent.newBuilder()
+.setGlobalTxId(globalTxId)
+.setLocalTxId(localTxId)
+.setServiceName(serviceName)
+.setInstanceId(instanceId)
+.setMethodName(method)
+.setStatus(status)
+.build();
+  }
+
+
   private GrpcAck onReceivedCoordinateCommand(GrpcTccCoordinateCommand 
command) {
 return GrpcAck.newBuilder().setAborted(false).build();
   }