[incubator-servicecomb-saga] branch master updated: SCB-830 update chassis from 1.0.0-m2 to 1.0.0 (#247)

2018-08-09 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 2431bf5  SCB-830 update chassis from 1.0.0-m2 to 1.0.0 (#247)
2431bf5 is described below

commit 2431bf578881759332b3bd7868bdc48a9fe346f4
Author: zhengyangyong 
AuthorDate: Fri Aug 10 10:35:43 2018 +0800

SCB-830 update chassis from 1.0.0-m2 to 1.0.0 (#247)

Signed-off-by: zhengyangyong 
---
 pom.xml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9597b3b..bd532ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,7 +57,7 @@
 2.6.1
 1.5.14.RELEASE
 2.0.3.RELEASE
-1.0.0-m2
+1.0.0
 4.3.18.RELEASE
 2.5.6
 0.12
@@ -72,7 +72,6 @@
 1.1.1
 3.0.2
 2.0.7.Final
-1.0.0-m2
 4.1.24.Final
   
 



[incubator-servicecomb-saga] branch master updated: [SCB-823] Setup the test in kubernetes (#243)

2018-08-10 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 2b73537  [SCB-823] Setup the test in kubernetes (#243)
2b73537 is described below

commit 2b735373bd328a056c1a9e663ddee275725dfc73
Author: crystaldust 
AuthorDate: Fri Aug 10 21:28:18 2018 +0800

[SCB-823] Setup the test in kubernetes (#243)

* Add the yaml files for kubernetes deployment

* Rename the k8s demo folder to saga-k8s-demo/

* Re-organize the folder structure of k8s resource.
Rename the saga-k8s-demo folder with saga-k8s-resources. The resources
folder provide the base resources(alpha-server and postgresql) and other
demos' k8s resources.
spring-demo's resources is now included.

* Add ASF header for yamls in base/ and spring-demo/

* Add jmeter for spring-demo load testing.
- jmeter.yaml: The jmeter deployment
- jmeter.configmap.yaml: The jmeter script content used by jmeter pod.

* Move the jmeter resources to test folder

* Add the README file for kuberenetes demos
---
 saga-demo/saga-k8s-resources/README.md |  72 ++
 saga-demo/saga-k8s-resources/base/alpha.yaml   |  54 
 saga-demo/saga-k8s-resources/base/postgresql.yaml  |  60 +
 .../saga-k8s-resources/spring-demo/booking.yaml|  73 ++
 saga-demo/saga-k8s-resources/spring-demo/car.yaml  |  55 
 .../saga-k8s-resources/spring-demo/hotel.yaml  |  55 
 .../spring-demo/test/jmeter.configmap.yaml | 282 +
 .../spring-demo/test/jmeter.yaml   |  54 
 8 files changed, 705 insertions(+)

diff --git a/saga-demo/saga-k8s-resources/README.md 
b/saga-demo/saga-k8s-resources/README.md
new file mode 100644
index 000..a10588c
--- /dev/null
+++ b/saga-demo/saga-k8s-resources/README.md
@@ -0,0 +1,72 @@
+# Deploy & test saga with Kubernetes
+
+You can now play with saga under Kubernetes!
+
+The demos' Kubernetes resources are splitted into 3 categories:
+
+- **base**: The base resources that all demos needs under `base/` folder, 
including the `alpha-server` and `postgresql` database
+- **demos**: The resources that each demo will consume, stored in the folder 
named with `xxx-demo/`
+- **tests**: A [jmeter](https://jmeter.apache.org/) deployment is provided for 
each demo under the demo's `test/` folder, there is also a [Kubernetes 
configmap](http://kubernetes-v1-4.github.io/docs/user-guide/configmap/) where 
you can change and apply the jmeter test plans. So you can change the plan at 
any time and pull up the jmeter deployment to test the demos.
+
+
+
+## Get started
+
+All the Kubernetes objects will be deployed in the `servicecomb` namespace, so 
make sure it is there with the command:
+
+```bash
+$ kubectl create namespace servicecomb
+namespace "servicecomb" created
+```
+
+Let's take the `spring-demo` as the example, apply the base and demo resources:
+
+```bash
+$ kubectl apply -f ./base
+service "alpha-server" created
+deployment "alphaserver" created
+service "postgresql" created
+deployment "database" created
+
+$ kubectl apply -f ./spring-demo
+service "booking" created
+deployment "booking" created
+service "car" created
+deployment "car" created
+service "hotel" created
+deployment "hotel" created
+
+```
+
+Make sure all the services in the demo are up and running:
+
+```bash
+$ kubectl get pods -n servicecomb
+NAME   READY STATUSRESTARTS   AGE
+alphaserver-6cb48898fc-tlqtb   1/1   Running   0  1d
+booking-666c8f4dbb-k5glt   1/1   Running   0  4h
+car-975d666f8-prs9p1/1   Running   0  1d
+database-796fc68b98-mhz8n  1/1   Running   0  1d
+hotel-768b59dfcd-gc7sn 1/1   Running   0  1d
+```
+
+Then you can test the demo with jmeter, modify the configmap according to your 
test plan, then apply the test service to Kubernetes api server:
+
+```bash
+$ vim ./spring-demo/test/jmeter.configmap.yaml
+$ # edit the file as you wish, mind the identation of yamls
+$ kubectl apply -f ./spring-demo/test/
+configmap "springdemo-jmeter-script" created
+deployment "spring-demo-jmeter" created
+
+$ kubectl get pods -n servicecomb | grep jmeter
+spring-demo-jmeter-6cfb679f58-sckkx   1/1   Running   0  12s
+```
+
+The jmeter deployment will keep testing the demo and generate the test result. 
For now the the result file is stored in the Kubernetes nodes under the path 
`/saga-jmeter-result/{demo_name}.jtl`. You can generate the HTML dashboard with 
the command:
+
+```bash
+$ jmeter -g /saga-jmeter-result/{demo_name}.jtl -o output/
+```
+
+We will try to p

[incubator-servicecomb-saga] branch master updated: SCB-823 Fix the spring-demo image repo name. (#252)

2018-08-13 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 bf04b2e  SCB-823 Fix the spring-demo image repo name. (#252)
bf04b2e is described below

commit bf04b2e991f4cf3dd5021a1d8d452b00309ff923
Author: crystaldust 
AuthorDate: Tue Aug 14 11:41:37 2018 +0800

SCB-823 Fix the spring-demo image repo name. (#252)
---
 saga-demo/saga-k8s-resources/base/alpha.yaml  | 2 +-
 saga-demo/saga-k8s-resources/base/jmeter-collector.yaml   | 2 +-
 saga-demo/saga-k8s-resources/spring-demo/booking.yaml | 2 +-
 saga-demo/saga-k8s-resources/spring-demo/car.yaml | 2 +-
 saga-demo/saga-k8s-resources/spring-demo/hotel.yaml   | 2 +-
 saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/saga-demo/saga-k8s-resources/base/alpha.yaml 
b/saga-demo/saga-k8s-resources/base/alpha.yaml
index 408c13b..79298d8 100644
--- a/saga-demo/saga-k8s-resources/base/alpha.yaml
+++ b/saga-demo/saga-k8s-resources/base/alpha.yaml
@@ -44,7 +44,7 @@ spec:
 spec:
   containers:
   - name: alphaserver
-image: saga/alpha-server:0.3.0-SNAPSHOT
+image: servicecomb/alpha-server:0.3.0-SNAPSHOT
 imagePullPolicy: IfNotPresent
 # ports:
 # - containerPort: 8080
diff --git a/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml 
b/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml
index 4492fa4..fb3d2e2 100644
--- a/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml
+++ b/saga-demo/saga-k8s-resources/base/jmeter-collector.yaml
@@ -47,7 +47,7 @@ spec:
 spec:
   containers:
   - name: jmeter-collector
-image: saga/jmeter-collector:v1
+image: servicecomb/jmeter-collector:v1
 imagePullPolicy: IfNotPresent
 ---
 
diff --git a/saga-demo/saga-k8s-resources/spring-demo/booking.yaml 
b/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
index 10f7c80..bd19a30 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/booking.yaml
@@ -45,7 +45,7 @@ spec:
 spec:
   containers:
   - name: booking
-image: saga/booking:0.3.0-SNAPSHOT
+image: servicecomb/booking:0.3.0-SNAPSHOT
 imagePullPolicy: IfNotPresent
 env:
 - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/car.yaml 
b/saga-demo/saga-k8s-resources/spring-demo/car.yaml
index 52a7451..d9ad6ab 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/car.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/car.yaml
@@ -45,7 +45,7 @@ spec:
 spec:
   containers:
   - name: car
-image: saga/car:0.3.0-SNAPSHOT
+image: servicecomb/car:0.3.0-SNAPSHOT
 imagePullPolicy: IfNotPresent
 env:
 - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml 
b/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
index 87f3808..37f9093 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/hotel.yaml
@@ -45,7 +45,7 @@ spec:
 spec:
   containers:
   - name: hotel
-image: saga/hotel:0.3.0-SNAPSHOT
+image: servicecomb/hotel:0.3.0-SNAPSHOT
 imagePullPolicy: IfNotPresent
 env:
 - name: JAVA_OPTS
diff --git a/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml 
b/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
index 8283d22..4126ca7 100644
--- a/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
+++ b/saga-demo/saga-k8s-resources/spring-demo/test/jmeter.yaml
@@ -29,7 +29,7 @@ spec:
 spec:
   containers:
   - name: spring-demo-jmeter
-image: saga/jmeter:v1
+image: servicecomb/jmeter:v1
 imagePullPolicy: IfNotPresent
 # TODO ReplicaSet, ReplicationController, Deployment, Daemonset only 
allow restartPolicy to be 'Always'
 # Maybe we should provide a custom test scheduler to scale up pods and 
let them exit naturally.



[incubator-servicecomb-java-chassis] branch master updated: [SCB-810] fix compile error for eclipse "Photon Release (4.8.0)"

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

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


The following commit(s) were added to refs/heads/master by this push:
 new e6aaeeb  [SCB-810] fix compile error for eclipse "Photon Release 
(4.8.0)"
e6aaeeb is described below

commit e6aaeeb8f824266b6b33f6e61f340c275f26c2c3
Author: wujimin 
AuthorDate: Mon Aug 20 22:49:06 2018 +0800

[SCB-810] fix compile error for eclipse "Photon Release (4.8.0)"
---
 handlers/handler-tracing-zipkin/pom.xml   | 3 +--
 java-chassis-distribution/src/release/LICENSE | 3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/handlers/handler-tracing-zipkin/pom.xml 
b/handlers/handler-tracing-zipkin/pom.xml
index 49274c6..5077806 100644
--- a/handlers/handler-tracing-zipkin/pom.xml
+++ b/handlers/handler-tracing-zipkin/pom.xml
@@ -59,10 +59,9 @@
   brave-context-log4j12
 
 
-  
   io.zipkin.java
   zipkin
-  test
+  compile
 
 
 
diff --git a/java-chassis-distribution/src/release/LICENSE 
b/java-chassis-distribution/src/release/LICENSE
index d241e54..c943057 100644
--- a/java-chassis-distribution/src/release/LICENSE
+++ b/java-chassis-distribution/src/release/LICENSE
@@ -456,5 +456,6 @@ Woodstox (https://github.com/FasterXML/woodstox) 
com.fasterxml.woodstox:woodstox
 Zipkin Reporter Spring Factory Beans 
(https://github.com/openzipkin/zipkin-reporter-java/zipkin-reporter-spring-beans)
 io.zipkin.reporter2:zipkin-reporter-spring-beans:jar:2.2.2
 Zipkin Reporter: Core 
(https://github.com/openzipkin/zipkin-reporter-java/zipkin-reporter) 
io.zipkin.reporter2:zipkin-reporter:jar:2.5.0
 Zipkin Sender: OkHttp 3 
(https://github.com/openzipkin/zipkin-reporter-java/zipkin-sender-okhttp3) 
io.zipkin.reporter2:zipkin-sender-okhttp3:jar:2.2.2
-Zipkin v2 (https://github.com/openzipkin/zipkin/zipkin) 
io.zipkin.zipkin2:zipkin:jar:2.4.2
+Zipkin v1 (https://github.com/openzipkin/zipkin/) 
io.zipkin.java:zipkin:jar:2.4.2
+Zipkin v2 (https://github.com/openzipkin/zipkin/) 
io.zipkin.zipkin2:zipkin:jar:2.4.2
 zuul-core (https://github.com/Netflix/zuul) 
com.netflix.zuul:zuul-core:jar:1.3.0



[incubator-servicecomb-saga] 02/04: SCB-855 Support JDK7 in saga-format test

2018-08-21 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 d300e17a6adc9df463d3b49a447818eed208e1b0
Author: KomachiSion <263976...@qq.com>
AuthorDate: Tue Aug 21 13:56:19 2018 +0800

SCB-855 Support JDK7 in saga-format test
---
 .../saga/format/JacksonFromJsonFormatTest.java | 80 --
 .../saga/format/JacksonRestOperationTest.java  | 11 ++-
 .../saga/format/JsonRestSagaRequestTest.java   |  8 ++-
 .../saga/format/SagaEventFormatTest.java   |  9 ++-
 4 files changed, 79 insertions(+), 29 deletions(-)

diff --git 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
index bbf7510..8214cc1 100644
--- 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
+++ 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
@@ -18,7 +18,6 @@
 package org.apache.servicecomb.saga.format;
 
 import static com.seanyinx.github.unit.scaffolding.Randomness.uniquify;
-import static java.util.Collections.emptyMap;
 import static java.util.Collections.singletonMap;
 import static org.hamcrest.Matchers.contains;
 import static org.hamcrest.core.Is.is;
@@ -27,12 +26,7 @@ import static org.junit.Assert.assertThat;
 import static org.mockito.Mockito.when;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
+import java.util.*;
 
 import org.apache.servicecomb.saga.core.Operation;
 import org.apache.servicecomb.saga.core.SagaException;
@@ -158,6 +152,41 @@ public class JacksonFromJsonFormatTest {
   private final TransportFactory transportFactory = 
Mockito.mock(TransportFactory.class);
   private final FromJsonFormat format = new 
JacksonFromJsonFormat(transportFactory);
 
+  private final Function getRequestId = new 
Function() {
+@Override
+public String apply(SagaRequest sagaRequest) {
+  return sagaRequest.id();
+}
+  };
+
+  private final Function getRequestServiceName = new 
Function() {
+@Override
+public String apply(SagaRequest sagaRequest) {
+  return sagaRequest.serviceName();
+}
+  };
+
+  private final Function getRequestType = new 
Function() {
+@Override
+public String apply(SagaRequest sagaRequest) {
+  return sagaRequest.type();
+}
+  };
+
+  private final Function getCompensationRetries = new 
Function() {
+@Override
+public Integer apply(SagaRequest sagaRequest) {
+  return sagaRequest.compensation().retries();
+}
+  };
+
+  private final Function getFallbackType = new 
Function() {
+@Override
+public String apply(SagaRequest sagaRequest) {
+  return sagaRequest.fallback().type();
+}
+  };
+
   @Before
   public void setUp() throws Exception {
 when(transportFactory.restTransport()).thenReturn(restTransport);
@@ -166,23 +195,24 @@ public class JacksonFromJsonFormatTest {
 .thenReturn(response11);
 when(restTransport.with("aaa", "/rest/as", "delete", singletonMap("query", 
singletonMap("bar", "as"
 .thenReturn(response12);
-when(restTransport.with("aaa", "/rest/as", "put", emptyMap()))
+when(restTransport.with("aaa", "/rest/as", "put", Collections.>emptyMap()))
 .thenReturn(response13);
 
 when(restTransport
-.with("bbb", "/rest/bs", "post", mapOf("query", singletonMap("foo", 
"bs"), "json", singletonMap("body", "{ \"bar\": \"bs\" }"
+.with("bbb", "/rest/bs", "post",
+mapOf("query", singletonMap("foo", "bs"), "json", 
singletonMap("body", "{ \"bar\": \"bs\" }"
 .thenReturn(response21);
-when(restTransport.with("bbb", "/rest/bs", "delete", emptyMap()))
+when(restTransport.with("bbb", "/rest/bs", "delete", Collections.>emptyMap()))
 .thenReturn(response22);
-when(restTransport.with("bbb", "/rest/bs", "put", emptyMap()))
+when(restTransport.with("bbb", "/rest/bs", "put", Collections.>emptyMap()))
 .thenReturn(response23);
 
 when(restTransport
 .with("ccc", "/rest/cs", "post", mapOf("query", singletonMap("foo", 
"cs&

[incubator-servicecomb-saga] 03/04: SCB-855 change maven-compiler supported jdk7

2018-08-21 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 00a6f4087aeed3566b5affba4409e4e1618c8c32
Author: KomachiSion <263976...@qq.com>
AuthorDate: Tue Aug 21 13:58:33 2018 +0800

SCB-855 change maven-compiler supported jdk7
---
 saga-format/pom.xml | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/saga-format/pom.xml b/saga-format/pom.xml
index 79e6fad..b69473b 100644
--- a/saga-format/pom.xml
+++ b/saga-format/pom.xml
@@ -16,7 +16,8 @@
   ~ limitations under the License.
   -->
 
-http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
   
 saga
 org.apache.servicecomb.saga
@@ -71,4 +72,19 @@
 
   
 
+  
+
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+3.1
+
+  UTF-8
+  1.7
+  1.7
+
+  
+
+  
+
 



[incubator-servicecomb-docs] 01/01: Merge pull request #36 from imlidian/master

2018-08-21 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-docs.git

commit dd13fde0004704f7c193cc22fb6a3ee3b7e16259
Merge: 82d911d 12f0d65
Author: Willem Jiang 
AuthorDate: Tue Aug 21 16:13:18 2018 +0800

Merge pull request #36 from imlidian/master

update .travis.yml for saga and sc

 .travis.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



[incubator-servicecomb-docs] branch master updated (82d911d -> dd13fde)

2018-08-21 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-docs.git.


from 82d911d  1. 补充错误处理文档。  2 将中英文的内容目录内容刷新到一致状态,方便翻译。  * 
[异常处理](general-development/error-handling.md) 中英文
 add 5965f85  update .travis.yml for saga and sc
 add 12f0d65  fix path issue of .travis.yml
 new dd13fde  Merge pull request #36 from imlidian/master

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


Summary of changes:
 .travis.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



[incubator-servicecomb-saga] 01/04: SCB-855 Support JDK7 in saga-format

2018-08-21 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 db95f8b80de1714837a55a13bcb2c0aac805eeba
Author: KomachiSion <263976...@qq.com>
AuthorDate: Tue Aug 21 13:56:04 2018 +0800

SCB-855 Support JDK7 in saga-format
---
 .../servicecomb/saga/format/ChildrenExtractor.java |  8 +++-
 .../saga/format/JacksonRestOperation.java  |  7 +++-
 .../saga/format/JacksonSagaEventFormat.java| 47 ++
 .../saga/format/JsonSagaDefinition.java|  5 ++-
 4 files changed, 55 insertions(+), 12 deletions(-)

diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java
index cfd3b1c..58cb1eb 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/ChildrenExtractor.java
@@ -21,6 +21,8 @@ import java.io.IOException;
 import java.util.HashSet;
 import java.util.Set;
 
+import com.fasterxml.jackson.databind.JsonNode;
+
 import org.apache.servicecomb.saga.core.SagaException;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -31,6 +33,7 @@ import 
org.apache.servicecomb.saga.core.application.interpreter.FromJsonFormat;
 public class ChildrenExtractor implements FromJsonFormat> {
 
   private static final String SAGA_CHILDREN = "sagaChildren";
+
   private final ObjectMapper objectMapper = new ObjectMapper();
 
   @Override
@@ -46,8 +49,9 @@ public class ChildrenExtractor implements 
FromJsonFormat> {
 Set children = new HashSet<>();
 
 if (value.has(SAGA_CHILDREN)) {
-  value.get(SAGA_CHILDREN)
-  .forEach(node -> children.add(node.textValue()));
+  for (JsonNode node : value.get(SAGA_CHILDREN)) {
+children.add(node.textValue());
+  }
 }
 
 return children;
diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
index 4d42451..10876fa 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
@@ -51,7 +51,12 @@ class JacksonRestOperation extends RestOperation implements 
TransportAware {
   @Override
   public SagaResponse send(String address, SagaResponse response) {
 Map> updated = new HashMap<>(params());
-updated.computeIfAbsent("form", (key) -> new HashMap<>()).put("response", 
response.body());
+// This is not thread safe
+if (updated.get("form") == null) {
+  HashMap formMap = new HashMap<>();
+  formMap.put("response", response.body());
+  updated.put("form", formMap);
+}
 
 return transport.with(
 address,
diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java
index 1b416aa..8b365c6 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSagaEventFormat.java
@@ -20,7 +20,6 @@ package org.apache.servicecomb.saga.format;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.function.BiFunction;
 
 import org.apache.servicecomb.saga.core.FailedSagaRequestContext;
 import org.apache.servicecomb.saga.core.NoOpSagaRequest;
@@ -40,12 +39,42 @@ import 
org.apache.servicecomb.saga.core.TransactionEndedEvent;
 
 public class JacksonSagaEventFormat implements SagaEventFormat {
   private final Map> 
eventFactories = new HashMap>() {{
-put(SagaStartedEvent.class.getSimpleName(), (sagaId, json) -> 
sagaStartedEvent(sagaId, json));
-put(TransactionStartedEvent.class.getSimpleName(), (sagaId, json) -> 
transactionStartedEvent(sagaId, json));
-put(TransactionEndedEvent.class.getSimpleName(), (sagaId, json) -> 
transactionEndedEvent(sagaId, json));
-put(TransactionAbortedEvent.class.getSimpleName(), (sagaId, json) -> 
transactionAbortedEvent(sagaId, json));
-put(TransactionCompensatedEvent.class.getSimpleName(), (sagaId, json) -> 
compensationEndedEvent(sagaId, json));
-put(SagaEndedEvent.class.getSimpleName(), (sagaId, json) -> 
sagaEndedEvent(sagaId));
+put(SagaStartedEvent.class.getSimpleName(), new BiFunction() {
+  @Override
+  public SagaEvent apply(String sagaId, String json) {
+return sagaStartedEvent(sagaId, json);
+  }
+});
+put(TransactionStartedEvent.class

[incubator-servicecomb-saga] branch master updated (13e5646 -> d64f3fc)

2018-08-21 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 13e5646  Fix the formate issue README
 new db95f8b  SCB-855 Support JDK7 in saga-format
 new d300e17  SCB-855 Support JDK7 in saga-format test
 new 00a6f40  SCB-855 change maven-compiler supported jdk7
 new d64f3fc  SCB-855 extract an empty map constant

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:
 saga-format/pom.xml| 18 -
 .../servicecomb/saga/format/ChildrenExtractor.java |  8 ++-
 .../saga/format/JacksonRestOperation.java  |  7 +-
 .../saga/format/JacksonSagaEventFormat.java| 47 +++--
 .../saga/format/JsonSagaDefinition.java|  5 +-
 .../saga/format/JacksonFromJsonFormatTest.java | 82 --
 .../saga/format/JacksonRestOperationTest.java  | 11 ++-
 .../saga/format/JsonRestSagaRequestTest.java   |  8 ++-
 .../saga/format/SagaEventFormatTest.java   | 10 ++-
 9 files changed, 154 insertions(+), 42 deletions(-)



[incubator-servicecomb-saga] 04/04: SCB-855 extract an empty map constant

2018-08-21 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 d64f3fc97005d03f55a1bd9a9c0014c307ba824f
Author: KomachiSion <263976...@qq.com>
AuthorDate: Tue Aug 21 16:29:28 2018 +0800

SCB-855 extract an empty map constant
---
 .../servicecomb/saga/format/JacksonFromJsonFormatTest.java   | 12 +++-
 .../apache/servicecomb/saga/format/SagaEventFormatTest.java  |  3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
index 8214cc1..f2ae724 100644
--- 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
+++ 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatTest.java
@@ -152,6 +152,8 @@ public class JacksonFromJsonFormatTest {
   private final TransportFactory transportFactory = 
Mockito.mock(TransportFactory.class);
   private final FromJsonFormat format = new 
JacksonFromJsonFormat(transportFactory);
 
+  private final Map> EMPTY_MAP = 
Collections.>emptyMap();
+
   private final Function getRequestId = new 
Function() {
 @Override
 public String apply(SagaRequest sagaRequest) {
@@ -195,24 +197,24 @@ public class JacksonFromJsonFormatTest {
 .thenReturn(response11);
 when(restTransport.with("aaa", "/rest/as", "delete", singletonMap("query", 
singletonMap("bar", "as"
 .thenReturn(response12);
-when(restTransport.with("aaa", "/rest/as", "put", Collections.>emptyMap()))
+when(restTransport.with("aaa", "/rest/as", "put", EMPTY_MAP))
 .thenReturn(response13);
 
 when(restTransport
 .with("bbb", "/rest/bs", "post",
 mapOf("query", singletonMap("foo", "bs"), "json", 
singletonMap("body", "{ \"bar\": \"bs\" }"
 .thenReturn(response21);
-when(restTransport.with("bbb", "/rest/bs", "delete", Collections.>emptyMap()))
+when(restTransport.with("bbb", "/rest/bs", "delete", EMPTY_MAP))
 .thenReturn(response22);
-when(restTransport.with("bbb", "/rest/bs", "put", Collections.>emptyMap()))
+when(restTransport.with("bbb", "/rest/bs", "put", EMPTY_MAP))
 .thenReturn(response23);
 
 when(restTransport
 .with("ccc", "/rest/cs", "post", mapOf("query", singletonMap("foo", 
"cs"), "form", singletonMap("bar", "cs"
 .thenReturn(response31);
-when(restTransport.with("ccc", "/rest/cs", "delete", Collections.>emptyMap()))
+when(restTransport.with("ccc", "/rest/cs", "delete", EMPTY_MAP))
 .thenReturn(response32);
-when(restTransport.with("ccc", "/rest/cs", "put", Collections.>emptyMap()))
+when(restTransport.with("ccc", "/rest/cs", "put", EMPTY_MAP))
 .thenReturn(response33);
   }
 
diff --git 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java
 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java
index 70bc4b8..fc509e4 100644
--- 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java
+++ 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/SagaEventFormatTest.java
@@ -62,13 +62,14 @@ import org.apache.servicecomb.saga.transports.RestTransport;
 public class SagaEventFormatTest {
 
   private final String sagaId = Randomness.uniquify("sagaId");
+  private final Map> EMPTY_MAP = 
Collections.>emptyMap();
   private final SagaRequest request = new SagaRequestImpl(
   sagaId,
   Randomness.uniquify("serviceName"),
   TYPE_REST,
   new JacksonRestTransaction("/rest/xxx", "POST", singletonMap("query", 
singletonMap("foo", "xxx"))),
   new JacksonRestCompensation("/rest/xxx", "DELETE", singletonMap("query", 
singletonMap("bar", "xxx"))),
-  new JacksonRestFallback(TYPE_REST, "/rest/xxx", "PUT", 
Collections.>emptyMap())
+  new JacksonRestFallback(TYPE_REST, "/rest/xxx", "PUT", EMPTY_MAP)
   );
 
   private final RestTransport restTransport = 
Mockito.mock(RestTransport.class);



[incubator-servicecomb-saga] branch SCB-665 updated (4efa3a9 -> 718893b)

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

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


from 4efa3a9  SCB-817 Updated the grpc file of TccEventService
 new 11fdb91  SCB-817 Updated the TCC grpc contract file
 new 718893b  SCB-818 Omega supports of TCC (WIP)

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:
 .../omega/transaction/tcc/TccEventService.java | 27 ++
 .../transaction/tcc/TccParticipatorAspect.java | 14 +--
 .../tcc/TccStartAnnotationProcessor.java   | 26 ++---
 .../saga/omega/transaction/tcc/TccStartAspect.java |  4 ++--
 ...articipateEvent.java => ParticipatedEvent.java} | 22 +-
 .../{TccEndEvent.java => TccEndedEvent.java}   | 11 +
 .../{TccStartEvent.java => TccStartedEvent.java}   | 11 -
 .../servicecomb/saga/common/TransactionStatus.java |  7 +++---
 .../src/main/proto/GrpcTccEvent.proto  |  3 ++-
 9 files changed, 91 insertions(+), 34 deletions(-)
 create mode 100644 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 rename 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/{ParticipateEvent.java
 => ParticipatedEvent.java} (55%)
 rename 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/{TccEndEvent.java
 => TccEndedEvent.java} (80%)
 rename 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/{TccStartEvent.java
 => TccStartedEvent.java} (82%)
 copy saga-core/src/main/java/org/apache/servicecomb/saga/core/SagaLog.java => 
pack-common/src/main/java/org/apache/servicecomb/saga/common/TransactionStatus.java
 (89%)



[incubator-servicecomb-saga] 02/02: SCB-818 Omega supports of TCC (WIP)

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

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

commit 718893b050f288ed60e79fd85b61f66705334c2e
Author: Willem Jiang 
AuthorDate: Tue Aug 21 10:25:13 2018 +0800

SCB-818 Omega supports of TCC (WIP)
---
 .../omega/transaction/tcc/TccEventService.java | 25 -
 .../transaction/tcc/TccParticipatorAspect.java | 14 ++--
 .../tcc/TccStartAnnotationProcessor.java   | 26 ++
 .../saga/omega/transaction/tcc/TccStartAspect.java |  4 ++--
 .../transaction/tcc/events/ParticipatedEvent.java  | 10 ++---
 .../transaction/tcc/events/TccEndedEvent.java  |  4 ++--
 .../transaction/tcc/events/TccStartedEvent.java|  4 ++--
 7 files changed, 61 insertions(+), 26 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
index 1649620..ae011bc 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -1,4 +1,27 @@
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
-public class TccService {
+import org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
+import org.apache.servicecomb.saga.omega.transaction.TxEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
+import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent;
+
+public interface TccEventService {
+
+  void onConnected();
+
+  void onDisconnected();
+
+  void close();
+
+  String target();
+
+  AlphaResponse participate(ParticipatedEvent participateEvent);
+
+  AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent);
+
+  AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent);
+
+  AlphaResponse send(TxEvent event);
+  
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
index 02adac2..e64bc2a 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import org.apache.servicecomb.saga.omega.transaction.MessageSender;
 import org.apache.servicecomb.saga.omega.transaction.OmegaException;
@@ -27,6 +28,7 @@ import 
org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
 import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Participate;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
@@ -39,9 +41,11 @@ public class TccParticipatorAspect {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final OmegaContext context;
+  private final TccEventService tccEventService;
 
-  public TccParticipatorAspect(MessageSender sender, OmegaContext context) {
+  public TccParticipatorAspect(TccEventService tccEventService, OmegaContext 
context) {
 this.context = context;
+this.tccEventService = tccEventService;
   }
 
   
@Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate
 * *(..)) && @annotation(participate)")
@@ -49,6 +53,7 @@ public class TccParticipatorAspect {
 Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
 String localTxId = context.localTxId();
 String cancelMethod = participate.cancelMethod();
+String confirmMethod = participate.confirmMethod();
 
 context.newLocalTxId();
 LOG.debug("Updated context {} for participate method {} ", context, 
method.toString());
@@ -56,13 +61,18 @@ public class TccParticipatorAspect {
 try {
   Object result = joinPoint.proceed();
   // Send the participate message back
+  tcc

[incubator-servicecomb-saga] 01/02: SCB-817 Updated the TCC grpc contract file

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

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

commit 11fdb9123e837f969c7c7c3b22485544a630f32e
Author: Willem Jiang 
AuthorDate: Tue Aug 21 09:59:02 2018 +0800

SCB-817 Updated the TCC grpc contract file
---
 .../omega/transaction/tcc/TccEventService.java |  4 
 .../{TccStartEvent.java => ParticipatedEvent.java} | 22 +-
 .../{TccEndEvent.java => TccEndedEvent.java}   |  9 ++---
 .../{TccStartEvent.java => TccStartedEvent.java}   |  9 +++--
 .../servicecomb/saga/common/TransactionStatus.java |  6 --
 .../src/main/proto/GrpcTccEvent.proto  |  3 ++-
 6 files changed, 28 insertions(+), 25 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
new file mode 100644
index 000..1649620
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -0,0 +1,4 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+public class TccService {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
similarity index 77%
copy from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
copy to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
index 416c182..73ede9c 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
@@ -16,26 +16,22 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
-public class TccStartEvent {
+
+public class ParticipateEvent {
+  
   private final String globalTxId;
   private final String localTxId;
   private final String parentTxId;
+  private final String confirmMethod;
+  private final String cancelMethod;
 
-  public String getGlobalTxId() {
-return globalTxId;
-  }
-
-  public String getLocalTxId() {
-return localTxId;
-  }
-
-  public String getParentTxId() {
-return parentTxId;
-  }
 
-  public TccStartEvent(String globalTxId, String localTxId, String parentTxId) 
{
+  public ParticipateEvent(String globalTxId, String localTxId, String 
parentTxId, String confirmMethod,
+  String cancelMethod) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
 this.parentTxId = parentTxId;
+this.confirmMethod = confirmMethod;
+this.cancelMethod = cancelMethod;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
similarity index 82%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
index 541489f..9107ab0 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
@@ -16,15 +16,18 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
+
 public class TccEndEvent {
   private final String globalTxId;
   private final String localTxId;
-  private final String parentTxId;
+  private final TransactionStatus status;

 
-  public TccEndEvent(String globalTxId, String localTxId, String parentTxId) {
+  public TccEndEvent(String globalTxId, String localTxId,
+  TransactionStatus status) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
-this.parentTxId = parentTxId;
+this.status = status;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartedEvent.java
similarity index 84%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/service

[incubator-servicecomb-saga] branch master updated: SCB-855 fix computeIfAbsent rewrite infinite loop error

2018-08-21 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 84194af  SCB-855 fix computeIfAbsent rewrite infinite loop error
84194af is described below

commit 84194afba716203a8d67a7876e446899dd5fcd17
Author: KomachiSion <263976...@qq.com>
AuthorDate: Tue Aug 21 18:01:59 2018 +0800

SCB-855 fix computeIfAbsent rewrite infinite loop error
---
 .../org/apache/servicecomb/saga/format/JacksonRestOperation.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
index 10876fa..c292168 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonRestOperation.java
@@ -53,10 +53,9 @@ class JacksonRestOperation extends RestOperation implements 
TransportAware {
 Map> updated = new HashMap<>(params());
 // This is not thread safe
 if (updated.get("form") == null) {
-  HashMap formMap = new HashMap<>();
-  formMap.put("response", response.body());
-  updated.put("form", formMap);
+  updated.put("form", new HashMap());
 }
+updated.get("form").put("response", response.body());
 
 return transport.with(
 address,



[incubator-servicecomb-saga] 02/07: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 7620c1e3300b1e9c4efa83683627657b85a7ea27
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:44:06 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   |  7 +++
 .../annotations/{TCC.java => Participate.java} | 14 ++---
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 ---
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 --
 .../transaction/tcc/TccParticipatorAspect.java | 68 ++
 .../tcc/TccStartAnnotationProcessor.java   |  6 +-
 .../saga/omega/transaction/tcc/TccStartAspect.java |  7 ++-
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 ---
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 ---
 .../omega/transaction/tcc/events/TccEndEvent.java  | 14 +
 .../transaction/tcc/events/TccStartEvent.java  | 25 
 .../tcc/events/TransactionEndEvent.java|  4 --
 .../tcc/events/TransationStartEvent.java   |  4 --
 13 files changed, 129 insertions(+), 112 deletions(-)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
index c9154f9..6c8afd2 100644
--- 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -12,4 +12,11 @@ import java.lang.annotation.Target;
 @Retention(RUNTIME)
 @Target(METHOD)
 public @interface TccStart {
+  /**
+   * TCC timeout, in seconds. 
+   * Default value is 0, which means never timeout.
+   *
+   * @return
+   */
+  int timeout() default 0;
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
similarity index 79%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
index a095978..8351076 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
@@ -25,22 +25,22 @@ import java.lang.annotation.Target;
 @Target({ElementType.METHOD})
 /**
  * Indicates the annotated method will start a sub-transaction. 
- * A @TCC method should satisfy below requirements:
+ * A @Participate method should satisfy below requirements:
  * 
  *   all parameters are serialized
  *   is idempotent
- *   the object instance which @TCC method resides in should be 
stateless
+ *   the object instance which @Participate method resides in should be 
stateless
  * 
  */
-public @interface TCC {
+public @interface Participate {
   /**
* Confirm method name.
* A confirm method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
@@ -51,10 +51,10 @@ public @interface TCC {
* Cancel method name.
* A cancel method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
deleted file mode 100644
index 173cb78..000
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.servicecomb.saga.omega.transaction.tcc;
-
-import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Method;
-
-import org.apache.servicecomb.saga.omega.context.OmegaContext;
-import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor;
-import org.apache.servicecomb.saga.omega.transaction.MessageSender;
-import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
-imp

[incubator-servicecomb-saga] branch SCB-665 updated (718893b -> 6a70e60)

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

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


omit 718893b  SCB-818 Omega supports of TCC (WIP)
omit 11fdb91  SCB-817 Updated the TCC grpc contract file
omit 4efa3a9  SCB-817 Updated the grpc file of TccEventService
omit 29bfbde  SCB-817 Added the License header
omit 277ff27  SCB-817 Updated the pack-contracts protocal for TCC
omit 0c16634  SCB-817 Added TCC events in Omega part (WIP)
omit 5b1ea96  SCB-817 Added TCC events in Omega part (WIP)
 add 67f9b95  Updated Readme file for the new added Omega plugins
 add 13e5646  Fix the formate issue README
 new a9d52d6  SCB-817 Added TCC events in Omega part (WIP)
 new 7620c1e  SCB-817 Added TCC events in Omega part (WIP)
 new cfdd2c9  SCB-817 Updated the pack-contracts protocal for TCC
 new d4a9731  SCB-817 Added the License headers
 new 4bdb8dc  SCB-817 Updated the grpc file of TccEventService
 new 0f167b0  SCB-817 Updated the TCC grpc contract file
 new 6a70e60  SCB-818 Omega supports of TCC (WIP)

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

 * -- * -- B -- O -- O -- O   (718893b)
\
 N -- N -- N   refs/heads/SCB-665 (6a70e60)

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

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

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


Summary of changes:
 README.md| 7 +--
 README_ZH.md | 8 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)



[incubator-servicecomb-saga] 04/07: SCB-817 Added the License headers

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

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

commit d4a9731d9f4b832d6ea8d02c3323102e588445ea
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:06:20 2018 +0800

SCB-817 Added the License headers
---
 .../transaction/tcc/TccStartAnnotationProcessor.java | 16 
 .../saga/omega/transaction/tcc/TccStartAspect.java   | 16 
 .../saga/omega/transaction/tcc/events/TccEndEvent.java   | 16 
 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 
 4 files changed, 64 insertions(+)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
index b38d876..b93373f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import javax.transaction.TransactionalException;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
index c8b7936..90728e3 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import java.lang.invoke.MethodHandles;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
index 1022aee..541489f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
@@ -1,3 +1,19 @@
+/*
+ * 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 perm

[incubator-servicecomb-saga] 04/07: SCB-817 Added the License headers

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

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

commit 8c0a63c56a57e9430ab7b9991781aadfeb86a24d
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:06:20 2018 +0800

SCB-817 Added the License headers
---
 .../transaction/tcc/TccStartAnnotationProcessor.java | 16 
 .../saga/omega/transaction/tcc/TccStartAspect.java   | 16 
 .../saga/omega/transaction/tcc/events/TccEndEvent.java   | 16 
 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 
 4 files changed, 64 insertions(+)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
index b38d876..b93373f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import javax.transaction.TransactionalException;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
index c8b7936..90728e3 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import java.lang.invoke.MethodHandles;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
index 1022aee..541489f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
@@ -1,3 +1,19 @@
+/*
+ * 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 perm

[incubator-servicecomb-saga] 03/07: SCB-817 Updated the pack-contracts protocal for TCC

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

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

commit cfdd2c919c8194de8c0550fe6a9fdaa2765026aa
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:52:19 2018 +0800

SCB-817 Updated the pack-contracts protocal for TCC
---
 .../proto/{GrpcTxEvent.proto => GrpcCommon.proto}  | 33 +
 .../{GrpcTxEvent.proto => GrpcTccEvent.proto}  | 43 --
 .../src/main/proto/GrpcTxEvent.proto   | 11 +-
 3 files changed, 26 insertions(+), 61 deletions(-)

diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
similarity index 58%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
index d2c6f77..40a8db7 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
@@ -19,15 +19,8 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
-  }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
-  rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
-  }
-}
+// Define the common structs which could be use for TccEventService and 
SagaEventService
 
 message GrpcServiceConfig {
   string serviceName = 1;
@@ -37,27 +30,3 @@ message GrpcServiceConfig {
 message GrpcAck {
   bool aborted = 1;
 }
-
-message GrpcTxEvent {
-  int64 timestamp = 1;
-  string globalTxId = 2;
-  string localTxId = 3;
-  string parentTxId = 4;
-  string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
-}
-
-message GrpcCompensateCommand {
-  string globalTxId = 1;
-  string localTxId = 2;
-  string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
-}
-
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
similarity index 60%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index d2c6f77..1eba5e5 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -19,45 +19,48 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
+option java_outer_classname = "TccEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
+import "GrpcCommon.proto";
+
+service TccEventService {
+  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
   }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
+  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
+  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcServiceConfig {
-  string serviceName = 1;
-  string instanceId = 2;
+message GrpcTransactionStartedEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
 }
 
-message GrpcAck {
-  bool aborted = 1;
+message GrpcParticipateEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
+  string confirmMethod = 6;
+  string cancelMethod = 7;
 }
 
-message GrpcTxEvent {
+message GrpcTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
   string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
 }
 
-message GrpcCompensateCommand {
+message GrpcCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
+  string type = 4;
 }
 
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
index d2c6f77..f037b4f 100644
--- a/pack-contracts/pack-

[incubator-servicecomb-saga] 07/07: SCB-818 Omega supports of TCC (WIP)

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

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

commit 7718071b991f13b5ca293c7e7543ac2b9102a2a4
Author: Willem Jiang 
AuthorDate: Tue Aug 21 10:25:13 2018 +0800

SCB-818 Omega supports of TCC (WIP)
---
 .../omega/transaction/tcc/TccEventService.java | 25 -
 .../transaction/tcc/TccParticipatorAspect.java | 14 ++--
 .../tcc/TccStartAnnotationProcessor.java   | 26 ++
 .../saga/omega/transaction/tcc/TccStartAspect.java |  4 ++--
 .../transaction/tcc/events/ParticipatedEvent.java  | 10 ++---
 .../transaction/tcc/events/TccEndedEvent.java  |  4 ++--
 .../transaction/tcc/events/TccStartedEvent.java|  4 ++--
 7 files changed, 61 insertions(+), 26 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
index 1649620..ae011bc 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -1,4 +1,27 @@
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
-public class TccService {
+import org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
+import org.apache.servicecomb.saga.omega.transaction.TxEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
+import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent;
+
+public interface TccEventService {
+
+  void onConnected();
+
+  void onDisconnected();
+
+  void close();
+
+  String target();
+
+  AlphaResponse participate(ParticipatedEvent participateEvent);
+
+  AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent);
+
+  AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent);
+
+  AlphaResponse send(TxEvent event);
+  
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
index 02adac2..e64bc2a 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import org.apache.servicecomb.saga.omega.transaction.MessageSender;
 import org.apache.servicecomb.saga.omega.transaction.OmegaException;
@@ -27,6 +28,7 @@ import 
org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
 import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Participate;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
@@ -39,9 +41,11 @@ public class TccParticipatorAspect {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final OmegaContext context;
+  private final TccEventService tccEventService;
 
-  public TccParticipatorAspect(MessageSender sender, OmegaContext context) {
+  public TccParticipatorAspect(TccEventService tccEventService, OmegaContext 
context) {
 this.context = context;
+this.tccEventService = tccEventService;
   }
 
   
@Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate
 * *(..)) && @annotation(participate)")
@@ -49,6 +53,7 @@ public class TccParticipatorAspect {
 Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
 String localTxId = context.localTxId();
 String cancelMethod = participate.cancelMethod();
+String confirmMethod = participate.confirmMethod();
 
 context.newLocalTxId();
 LOG.debug("Updated context {} for participate method {} ", context, 
method.toString());
@@ -56,13 +61,18 @@ public class TccParticipatorAspect {
 try {
   Object result = joinPoint.proceed();
   // Send the participate message back
+  tcc

[incubator-servicecomb-saga] 01/07: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 95ad81f6eef681b0773aabf0f5588d114a658d4d
Author: Willem Jiang 
AuthorDate: Sun Aug 12 11:16:22 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   | 15 +
 .../saga/omega/transaction/annotations/TCC.java| 64 ++
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 ++
 .../tcc/TccStartAnnotationProcessor.java   | 47 
 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 +++
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++
 .../transaction/tcc/events/ParticipateEvent.java   | 21 +++
 .../tcc/events/TransactionEndEvent.java|  4 ++
 .../tcc/events/TransationStartEvent.java   |  4 ++
 11 files changed, 307 insertions(+)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
new file mode 100644
index 000..c9154f9
--- /dev/null
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -0,0 +1,15 @@
+package org.apache.servicecomb.saga.omega.context.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates the annotated method will start a TCC .
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface TccStart {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
new file mode 100644
index 000..a095978
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.omega.transaction.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+/**
+ * Indicates the annotated method will start a sub-transaction. 
+ * A @TCC method should satisfy below requirements:
+ * 
+ *   all parameters are serialized
+ *   is idempotent
+ *   the object instance which @TCC method resides in should be 
stateless
+ * 
+ */
+public @interface TCC {
+  /**
+   * Confirm method name.
+   * A confirm method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String confirmMethod() default "";
+
+  /**
+   * Cancel method name.
+   * A cancel method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String cancelMethod() default "";
+
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
new file mode 100644
index 000..173cb78
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
@@ -0,0 +1,48 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+import java.lang.invoke.MethodH

[incubator-servicecomb-saga] 03/07: SCB-817 Updated the pack-contracts protocal for TCC

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

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

commit 09cb5743484de5ba802177b0bf487c6651ceea47
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:52:19 2018 +0800

SCB-817 Updated the pack-contracts protocal for TCC
---
 .../proto/{GrpcTxEvent.proto => GrpcCommon.proto}  | 33 +
 .../{GrpcTxEvent.proto => GrpcTccEvent.proto}  | 43 --
 .../src/main/proto/GrpcTxEvent.proto   | 11 +-
 3 files changed, 26 insertions(+), 61 deletions(-)

diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
similarity index 58%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
index d2c6f77..40a8db7 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
@@ -19,15 +19,8 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
-  }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
-  rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
-  }
-}
+// Define the common structs which could be use for TccEventService and 
SagaEventService
 
 message GrpcServiceConfig {
   string serviceName = 1;
@@ -37,27 +30,3 @@ message GrpcServiceConfig {
 message GrpcAck {
   bool aborted = 1;
 }
-
-message GrpcTxEvent {
-  int64 timestamp = 1;
-  string globalTxId = 2;
-  string localTxId = 3;
-  string parentTxId = 4;
-  string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
-}
-
-message GrpcCompensateCommand {
-  string globalTxId = 1;
-  string localTxId = 2;
-  string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
-}
-
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
similarity index 60%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index d2c6f77..1eba5e5 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -19,45 +19,48 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
+option java_outer_classname = "TccEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
+import "GrpcCommon.proto";
+
+service TccEventService {
+  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
   }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
+  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
+  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcServiceConfig {
-  string serviceName = 1;
-  string instanceId = 2;
+message GrpcTransactionStartedEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
 }
 
-message GrpcAck {
-  bool aborted = 1;
+message GrpcParticipateEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
+  string confirmMethod = 6;
+  string cancelMethod = 7;
 }
 
-message GrpcTxEvent {
+message GrpcTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
   string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
 }
 
-message GrpcCompensateCommand {
+message GrpcCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
+  string type = 4;
 }
 
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
index d2c6f77..f037b4f 100644
--- a/pack-contracts/pack-

[incubator-servicecomb-saga] 05/07: SCB-817 Updated the grpc file of TccEventService

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

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

commit 4bdb8dc1a98ebbee16b1200b13ed24dd7ecc7e39
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:10:07 2018 +0800

SCB-817 Updated the grpc file of TccEventService
---
 .../src/main/proto/GrpcTccEvent.proto  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index 1eba5e5..9e1752f 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto";
 import "GrpcCommon.proto";
 
 service TccEventService {
-  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) 
{
   }
-  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
-  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
+  rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {}
+  rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns 
(GrpcAck) {}
+  rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcTransactionStartedEvent {
+message GrpcTccTransactionStartedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
 }
 
-message GrpcParticipateEvent {
+message GrpcTccParticipateEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -49,7 +49,7 @@ message GrpcParticipateEvent {
   string cancelMethod = 7;
 }
 
-message GrpcTransactionEndedEvent {
+message GrpcTccTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent {
   string type = 5;
 }
 
-message GrpcCordinateCommand {
+message GrpcTccCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string type = 4;
+  string method = 4;
 }
 



[incubator-servicecomb-saga] 01/07: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit a9d52d6e4e824f349ae7b9e7fe46441c49be2c0f
Author: Willem Jiang 
AuthorDate: Sun Aug 12 11:16:22 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   | 15 +
 .../saga/omega/transaction/annotations/TCC.java| 64 ++
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 ++
 .../tcc/TccStartAnnotationProcessor.java   | 47 
 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 +++
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++
 .../transaction/tcc/events/ParticipateEvent.java   | 21 +++
 .../tcc/events/TransactionEndEvent.java|  4 ++
 .../tcc/events/TransationStartEvent.java   |  4 ++
 11 files changed, 307 insertions(+)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
new file mode 100644
index 000..c9154f9
--- /dev/null
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -0,0 +1,15 @@
+package org.apache.servicecomb.saga.omega.context.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates the annotated method will start a TCC .
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface TccStart {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
new file mode 100644
index 000..a095978
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.omega.transaction.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+/**
+ * Indicates the annotated method will start a sub-transaction. 
+ * A @TCC method should satisfy below requirements:
+ * 
+ *   all parameters are serialized
+ *   is idempotent
+ *   the object instance which @TCC method resides in should be 
stateless
+ * 
+ */
+public @interface TCC {
+  /**
+   * Confirm method name.
+   * A confirm method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String confirmMethod() default "";
+
+  /**
+   * Cancel method name.
+   * A cancel method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String cancelMethod() default "";
+
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
new file mode 100644
index 000..173cb78
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
@@ -0,0 +1,48 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+import java.lang.invoke.MethodH

[incubator-servicecomb-saga] 06/07: SCB-817 Updated the TCC grpc contract file

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

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

commit eae940b99500d31d7ee4780b11c920883ef6e508
Author: Willem Jiang 
AuthorDate: Tue Aug 21 09:59:02 2018 +0800

SCB-817 Updated the TCC grpc contract file
---
 .../omega/transaction/tcc/TccEventService.java |  4 
 .../{TccStartEvent.java => ParticipatedEvent.java} | 22 +-
 .../{TccEndEvent.java => TccEndedEvent.java}   |  9 ++---
 .../{TccStartEvent.java => TccStartedEvent.java}   |  9 +++--
 .../servicecomb/saga/common/TransactionStatus.java |  6 --
 .../src/main/proto/GrpcTccEvent.proto  |  3 ++-
 6 files changed, 28 insertions(+), 25 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
new file mode 100644
index 000..1649620
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -0,0 +1,4 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+public class TccService {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
similarity index 77%
copy from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
copy to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
index 416c182..73ede9c 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
@@ -16,26 +16,22 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
-public class TccStartEvent {
+
+public class ParticipateEvent {
+  
   private final String globalTxId;
   private final String localTxId;
   private final String parentTxId;
+  private final String confirmMethod;
+  private final String cancelMethod;
 
-  public String getGlobalTxId() {
-return globalTxId;
-  }
-
-  public String getLocalTxId() {
-return localTxId;
-  }
-
-  public String getParentTxId() {
-return parentTxId;
-  }
 
-  public TccStartEvent(String globalTxId, String localTxId, String parentTxId) 
{
+  public ParticipateEvent(String globalTxId, String localTxId, String 
parentTxId, String confirmMethod,
+  String cancelMethod) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
 this.parentTxId = parentTxId;
+this.confirmMethod = confirmMethod;
+this.cancelMethod = cancelMethod;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
similarity index 82%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
index 541489f..9107ab0 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
@@ -16,15 +16,18 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
+
 public class TccEndEvent {
   private final String globalTxId;
   private final String localTxId;
-  private final String parentTxId;
+  private final TransactionStatus status;

 
-  public TccEndEvent(String globalTxId, String localTxId, String parentTxId) {
+  public TccEndEvent(String globalTxId, String localTxId,
+  TransactionStatus status) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
-this.parentTxId = parentTxId;
+this.status = status;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartedEvent.java
similarity index 84%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/service

[incubator-servicecomb-saga] 02/07: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 35d946c7f94680aa6d8a257dc2b9165353737413
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:44:06 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   |  7 +++
 .../annotations/{TCC.java => Participate.java} | 14 ++---
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 ---
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 --
 .../transaction/tcc/TccParticipatorAspect.java | 68 ++
 .../tcc/TccStartAnnotationProcessor.java   |  6 +-
 .../saga/omega/transaction/tcc/TccStartAspect.java |  7 ++-
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 ---
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 ---
 .../omega/transaction/tcc/events/TccEndEvent.java  | 14 +
 .../transaction/tcc/events/TccStartEvent.java  | 25 
 .../tcc/events/TransactionEndEvent.java|  4 --
 .../tcc/events/TransationStartEvent.java   |  4 --
 13 files changed, 129 insertions(+), 112 deletions(-)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
index c9154f9..6c8afd2 100644
--- 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -12,4 +12,11 @@ import java.lang.annotation.Target;
 @Retention(RUNTIME)
 @Target(METHOD)
 public @interface TccStart {
+  /**
+   * TCC timeout, in seconds. 
+   * Default value is 0, which means never timeout.
+   *
+   * @return
+   */
+  int timeout() default 0;
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
similarity index 79%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
index a095978..8351076 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
@@ -25,22 +25,22 @@ import java.lang.annotation.Target;
 @Target({ElementType.METHOD})
 /**
  * Indicates the annotated method will start a sub-transaction. 
- * A @TCC method should satisfy below requirements:
+ * A @Participate method should satisfy below requirements:
  * 
  *   all parameters are serialized
  *   is idempotent
- *   the object instance which @TCC method resides in should be 
stateless
+ *   the object instance which @Participate method resides in should be 
stateless
  * 
  */
-public @interface TCC {
+public @interface Participate {
   /**
* Confirm method name.
* A confirm method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
@@ -51,10 +51,10 @@ public @interface TCC {
* Cancel method name.
* A cancel method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
deleted file mode 100644
index 173cb78..000
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.servicecomb.saga.omega.transaction.tcc;
-
-import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Method;
-
-import org.apache.servicecomb.saga.omega.context.OmegaContext;
-import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor;
-import org.apache.servicecomb.saga.omega.transaction.MessageSender;
-import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
-imp

[incubator-servicecomb-saga] 05/07: SCB-817 Updated the grpc file of TccEventService

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

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

commit b70984aba1ac8172cb4df387bed44eb0a8e264b0
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:10:07 2018 +0800

SCB-817 Updated the grpc file of TccEventService
---
 .../src/main/proto/GrpcTccEvent.proto  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index 1eba5e5..9e1752f 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto";
 import "GrpcCommon.proto";
 
 service TccEventService {
-  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) 
{
   }
-  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
-  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
+  rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {}
+  rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns 
(GrpcAck) {}
+  rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcTransactionStartedEvent {
+message GrpcTccTransactionStartedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
 }
 
-message GrpcParticipateEvent {
+message GrpcTccParticipateEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -49,7 +49,7 @@ message GrpcParticipateEvent {
   string cancelMethod = 7;
 }
 
-message GrpcTransactionEndedEvent {
+message GrpcTccTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent {
   string type = 5;
 }
 
-message GrpcCordinateCommand {
+message GrpcTccCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string type = 4;
+  string method = 4;
 }
 



[incubator-servicecomb-saga] branch SCB-665 updated (6a70e60 -> 7718071)

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

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


 discard 6a70e60  SCB-818 Omega supports of TCC (WIP)
 discard 0f167b0  SCB-817 Updated the TCC grpc contract file
 discard 4bdb8dc  SCB-817 Updated the grpc file of TccEventService
 discard d4a9731  SCB-817 Added the License headers
 discard cfdd2c9  SCB-817 Updated the pack-contracts protocal for TCC
 discard 7620c1e  SCB-817 Added TCC events in Omega part (WIP)
 discard a9d52d6  SCB-817 Added TCC events in Omega part (WIP)
 add db95f8b  SCB-855 Support JDK7 in saga-format
 add d300e17  SCB-855 Support JDK7 in saga-format test
 add 00a6f40  SCB-855 change maven-compiler supported jdk7
 add d64f3fc  SCB-855 extract an empty map constant
 add 84194af  SCB-855 fix computeIfAbsent rewrite infinite loop error
 add 0e3593e  [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - 
Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and 
MessageDeserializer property. - Refactoring the constructor of 
LoadBalancedClusterMessageSender. - Modifying respective test cases and 
references. - Killing some issue detected by SonarLint.
 new 95ad81f  SCB-817 Added TCC events in Omega part (WIP)
 new 35d946c  SCB-817 Added TCC events in Omega part (WIP)
 new 09cb574  SCB-817 Updated the pack-contracts protocal for TCC
 new 8c0a63c  SCB-817 Added the License headers
 new b70984a  SCB-817 Updated the grpc file of TccEventService
 new eae940b  SCB-817 Updated the TCC grpc contract file
 new 7718071  SCB-818 Omega supports of TCC (WIP)

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

 * -- * -- B -- O -- O -- O   (6a70e60)
\
 N -- N -- N   refs/heads/SCB-665 (7718071)

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

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

The 7 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:
 .../omega/connector/grpc/AlphaClusterConfig.java   | 122 -
 .../grpc/LoadBalancedClusterMessageSender.java |  22 ++--
 ...LoadBalanceClusterMessageSenderWithTLSTest.java |  38 ---
 .../grpc/LoadBalancedClusterMessageSenderTest.java |  40 ++-
 .../saga/omega/spring/OmegaSpringConfig.java   |  22 ++--
 saga-format/pom.xml|  18 ++-
 .../servicecomb/saga/format/ChildrenExtractor.java |   8 +-
 .../saga/format/JacksonRestOperation.java  |   6 +-
 .../saga/format/JacksonSagaEventFormat.java|  47 ++--
 .../saga/format/JsonSagaDefinition.java|   5 +-
 .../saga/format/JacksonFromJsonFormatTest.java |  82 ++
 .../saga/format/JacksonRestOperationTest.java  |  11 +-
 .../saga/format/JsonRestSagaRequestTest.java   |   8 +-
 .../saga/format/SagaEventFormatTest.java   |  10 +-
 14 files changed, 324 insertions(+), 115 deletions(-)



[incubator-servicecomb-saga] 07/07: SCB-818 Omega supports of TCC (WIP)

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

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

commit 6a70e60d5280800b9a008074aa08e984d9d20256
Author: Willem Jiang 
AuthorDate: Tue Aug 21 10:25:13 2018 +0800

SCB-818 Omega supports of TCC (WIP)
---
 .../omega/transaction/tcc/TccEventService.java | 25 -
 .../transaction/tcc/TccParticipatorAspect.java | 14 ++--
 .../tcc/TccStartAnnotationProcessor.java   | 26 ++
 .../saga/omega/transaction/tcc/TccStartAspect.java |  4 ++--
 .../transaction/tcc/events/ParticipatedEvent.java  | 10 ++---
 .../transaction/tcc/events/TccEndedEvent.java  |  4 ++--
 .../transaction/tcc/events/TccStartedEvent.java|  4 ++--
 7 files changed, 61 insertions(+), 26 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
index 1649620..ae011bc 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -1,4 +1,27 @@
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
-public class TccService {
+import org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
+import org.apache.servicecomb.saga.omega.transaction.TxEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
+import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent;
+
+public interface TccEventService {
+
+  void onConnected();
+
+  void onDisconnected();
+
+  void close();
+
+  String target();
+
+  AlphaResponse participate(ParticipatedEvent participateEvent);
+
+  AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent);
+
+  AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent);
+
+  AlphaResponse send(TxEvent event);
+  
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
index 02adac2..e64bc2a 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import org.apache.servicecomb.saga.omega.transaction.MessageSender;
 import org.apache.servicecomb.saga.omega.transaction.OmegaException;
@@ -27,6 +28,7 @@ import 
org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
 import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Participate;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
@@ -39,9 +41,11 @@ public class TccParticipatorAspect {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final OmegaContext context;
+  private final TccEventService tccEventService;
 
-  public TccParticipatorAspect(MessageSender sender, OmegaContext context) {
+  public TccParticipatorAspect(TccEventService tccEventService, OmegaContext 
context) {
 this.context = context;
+this.tccEventService = tccEventService;
   }
 
   
@Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate
 * *(..)) && @annotation(participate)")
@@ -49,6 +53,7 @@ public class TccParticipatorAspect {
 Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
 String localTxId = context.localTxId();
 String cancelMethod = participate.cancelMethod();
+String confirmMethod = participate.confirmMethod();
 
 context.newLocalTxId();
 LOG.debug("Updated context {} for participate method {} ", context, 
method.toString());
@@ -56,13 +61,18 @@ public class TccParticipatorAspect {
 try {
   Object result = joinPoint.proceed();
   // Send the participate message back
+  tcc

[incubator-servicecomb-saga] branch SCB-665 updated (7718071 -> 07af536)

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

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


 discard 7718071  SCB-818 Omega supports of TCC (WIP)
 discard eae940b  SCB-817 Updated the TCC grpc contract file
 discard b70984a  SCB-817 Updated the grpc file of TccEventService
 discard 8c0a63c  SCB-817 Added the License headers
 discard 09cb574  SCB-817 Updated the pack-contracts protocal for TCC
 discard 35d946c  SCB-817 Added TCC events in Omega part (WIP)
 discard 95ad81f  SCB-817 Added TCC events in Omega part (WIP)
 add 11dff7b  Add the debugging method in spring-demo's document.
 add f375c61  Add the ref to debugging in other demos' documents.
 add 4c8b15f  Add the ref to debugging in root document's quick start 
section.
 new f8cd69c  SCB-817 Added TCC events in Omega part (WIP)
 new 780f324  SCB-817 Added TCC events in Omega part (WIP)
 new 258c2de  SCB-817 Updated the pack-contracts protocal for TCC
 new 8ce5019  SCB-817 Added the License headers
 new a460887  SCB-817 Updated the grpc file of TccEventService
 new d067ce7  SCB-817 Updated the TCC grpc contract file
 new 0cc9678  SCB-818 Omega supports of TCC (WIP)
 new 07af536  SCB-817 Updated the pack-contracts protocal for TCC

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

 * -- * -- B -- O -- O -- O   (7718071)
\
 N -- N -- N   refs/heads/SCB-665 (07af536)

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

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

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


Summary of changes:
 README.md   |  1 +
 README_ZH.md|  1 +
 .../src/main/proto/GrpcTccEvent.proto   | 21 ++---
 saga-demo/conditional-transaction-demo/README.md|  3 +++
 .../dependency-free-transaction-demo/README.md  |  3 +++
 saga-demo/saga-dubbo-demo/README.md |  8 ++--
 saga-demo/saga-servicecomb-demo/README.md   |  5 -
 saga-demo/saga-spring-demo/README.md| 18 ++
 8 files changed, 50 insertions(+), 10 deletions(-)



[incubator-servicecomb-saga] 02/08: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 780f324e7173181cfed6a764377a74735d502d63
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:44:06 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   |  7 +++
 .../annotations/{TCC.java => Participate.java} | 14 ++---
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 ---
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 --
 .../transaction/tcc/TccParticipatorAspect.java | 68 ++
 .../tcc/TccStartAnnotationProcessor.java   |  6 +-
 .../saga/omega/transaction/tcc/TccStartAspect.java |  7 ++-
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 ---
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 ---
 .../omega/transaction/tcc/events/TccEndEvent.java  | 14 +
 .../transaction/tcc/events/TccStartEvent.java  | 25 
 .../tcc/events/TransactionEndEvent.java|  4 --
 .../tcc/events/TransationStartEvent.java   |  4 --
 13 files changed, 129 insertions(+), 112 deletions(-)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
index c9154f9..6c8afd2 100644
--- 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -12,4 +12,11 @@ import java.lang.annotation.Target;
 @Retention(RUNTIME)
 @Target(METHOD)
 public @interface TccStart {
+  /**
+   * TCC timeout, in seconds. 
+   * Default value is 0, which means never timeout.
+   *
+   * @return
+   */
+  int timeout() default 0;
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
similarity index 79%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
index a095978..8351076 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
@@ -25,22 +25,22 @@ import java.lang.annotation.Target;
 @Target({ElementType.METHOD})
 /**
  * Indicates the annotated method will start a sub-transaction. 
- * A @TCC method should satisfy below requirements:
+ * A @Participate method should satisfy below requirements:
  * 
  *   all parameters are serialized
  *   is idempotent
- *   the object instance which @TCC method resides in should be 
stateless
+ *   the object instance which @Participate method resides in should be 
stateless
  * 
  */
-public @interface TCC {
+public @interface Participate {
   /**
* Confirm method name.
* A confirm method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
@@ -51,10 +51,10 @@ public @interface TCC {
* Cancel method name.
* A cancel method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
deleted file mode 100644
index 173cb78..000
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.servicecomb.saga.omega.transaction.tcc;
-
-import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Method;
-
-import org.apache.servicecomb.saga.omega.context.OmegaContext;
-import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor;
-import org.apache.servicecomb.saga.omega.transaction.MessageSender;
-import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
-imp

[incubator-servicecomb-saga] 04/08: SCB-817 Added the License headers

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

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

commit 8ce5019a836ddd7b212e533cdc3d3ec44662e18b
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:06:20 2018 +0800

SCB-817 Added the License headers
---
 .../transaction/tcc/TccStartAnnotationProcessor.java | 16 
 .../saga/omega/transaction/tcc/TccStartAspect.java   | 16 
 .../saga/omega/transaction/tcc/events/TccEndEvent.java   | 16 
 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 
 4 files changed, 64 insertions(+)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
index b38d876..b93373f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import javax.transaction.TransactionalException;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
index c8b7936..90728e3 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import java.lang.invoke.MethodHandles;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
index 1022aee..541489f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
@@ -1,3 +1,19 @@
+/*
+ * 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 perm

[incubator-servicecomb-saga] branch master updated (0e3593e -> 4c8b15f)

2018-08-22 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 0e3593e  [SCB-745] Applying Builder Pattern on AlphaClusterConfig. - 
Extending AlphaClusterConfig by adding MessageHandler, MessageSerializer and 
MessageDeserializer property. - Refactoring the constructor of 
LoadBalancedClusterMessageSender. - Modifying respective test cases and 
references. - Killing some issue detected by SonarLint.
 new 11dff7b  Add the debugging method in spring-demo's document.
 new f375c61  Add the ref to debugging in other demos' documents.
 new 4c8b15f  Add the ref to debugging in root document's quick start 
section.

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


Summary of changes:
 README.md|  1 +
 README_ZH.md |  1 +
 saga-demo/conditional-transaction-demo/README.md |  3 +++
 saga-demo/dependency-free-transaction-demo/README.md |  3 +++
 saga-demo/saga-dubbo-demo/README.md  |  8 ++--
 saga-demo/saga-servicecomb-demo/README.md|  5 -
 saga-demo/saga-spring-demo/README.md | 18 ++
 7 files changed, 36 insertions(+), 3 deletions(-)



[incubator-servicecomb-saga] 02/03: Add the ref to debugging in other demos' documents.

2018-08-22 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 f375c613d3e6916287149a5b7066d8cdf89ed495
Author: Zhen Ju 
AuthorDate: Wed Aug 22 16:14:41 2018 +0800

Add the ref to debugging in other demos' documents.
---
 saga-demo/conditional-transaction-demo/README.md | 3 +++
 saga-demo/dependency-free-transaction-demo/README.md | 3 +++
 saga-demo/saga-dubbo-demo/README.md  | 8 ++--
 saga-demo/saga-servicecomb-demo/README.md| 5 -
 4 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/saga-demo/conditional-transaction-demo/README.md 
b/saga-demo/conditional-transaction-demo/README.md
index 9ae1deb..505a666 100755
--- a/saga-demo/conditional-transaction-demo/README.md
+++ b/saga-demo/conditional-transaction-demo/README.md
@@ -172,3 +172,6 @@ So the 2nd request will trigger product 
replenishment from supplier.
 for simplicity.
 
 To see all events generated by Saga, visit 
`http://:8083/events` with postman.
+
+## Debugging
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
diff --git a/saga-demo/dependency-free-transaction-demo/README.md 
b/saga-demo/dependency-free-transaction-demo/README.md
index 611dfa5..4fb6e0f 100755
--- a/saga-demo/dependency-free-transaction-demo/README.md
+++ b/saga-demo/dependency-free-transaction-demo/README.md
@@ -166,3 +166,6 @@ Sending the request more than once will trigger 
compensation due to insufficient
 for simplicity.
 
 To see all events generated by Saga, visit 
`http://:8083/events` with browser.
+
+## Debugging
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
diff --git a/saga-demo/saga-dubbo-demo/README.md 
b/saga-demo/saga-dubbo-demo/README.md
index 098fd85..deadb4f 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -15,6 +15,10 @@ You will need:
 [alpha_server]: 
https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha
 
 ## Running Demo
-1.mvn clean install -DskipTests -Pdocker
-2. ./saga-dubbo-demo.sh up
+```bash
+$ mvn clean install -DskipTests -Pdocker
+$ ./saga-dubbo-demo.sh up
+```
 
+## Debugging
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.
diff --git a/saga-demo/saga-servicecomb-demo/README.md 
b/saga-demo/saga-servicecomb-demo/README.md
index f9cd821..e08b416 100644
--- a/saga-demo/saga-servicecomb-demo/README.md
+++ b/saga-demo/saga-servicecomb-demo/README.md
@@ -58,4 +58,7 @@ Check the car booking status with
 ```
 curl http://${host_address}:8082/bookings
 ```
-The second car booking will be marked with **cancel:true**
\ No newline at end of file
+The second car booking will be marked with **cancel:true**
+
+## Debugging
+Take the [spring-demo debugging](../saga-spring-demo#debugging) as a reference.



[incubator-servicecomb-saga] 03/03: Add the ref to debugging in root document's quick start section.

2018-08-22 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 4c8b15f90a865384535f0ee154c271b4753f453a
Author: Zhen Ju 
AuthorDate: Wed Aug 22 16:15:11 2018 +0800

Add the ref to debugging in root document's quick start section.
---
 README.md| 1 +
 README_ZH.md | 1 +
 2 files changed, 2 insertions(+)

diff --git a/README.md b/README.md
index eb009f4..48ca2ad 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@ See [Saga Pack Design](docs/design.md) for details.
 * For ServiceComb Java Chassis application, please see [Booking 
Demo](saga-demo/saga-servicecomb-demo/README.md) for details.
 * For Spring applications, please see [Booking 
Demo](saga-demo/saga-spring-demo/README.md) for details.
 * For Dubbo applications, please see [Dubbo 
Demo](saga-demo/saga-dubbo-demo/README.md) for details.
+* To debug the applications, please see [Spring Demo 
Debugging](saga-demo/saga-spring-demo#debugging) for details.
 
 ## Build and Run the tests from source
 * Build the source code and run the tests
diff --git a/README_ZH.md b/README_ZH.md
index 0531441..200086f 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -27,6 +27,7 @@ Saga是由 **alpha** 和 **omega**组成,其中:
 * Saga在ServiceComb Java 
Chassis应用可以参考[出行预订](saga-demo/saga-servicecomb-demo/README.md)
 * Saga在Spring应用的用法可参考[出行预订示例](saga-demo/saga-spring-demo/README.md)。
 * Saga在Dubbo应用的用法可参考[Dubbo示例](saga-demo/saga-dubbo-demo/README.md).
+* Saga的调试方法可以参考[调试Spring示例](saga-demo/saga-spring-demo#debugging).
 
 ## 编译和运行代码
 * 编译代码并且运行相关的单元测试



[incubator-servicecomb-saga] 01/03: Add the debugging method in spring-demo's document.

2018-08-22 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 11dff7bfe9bede80e6b897fd9f4e05c8f6fea8f9
Author: Zhen Ju 
AuthorDate: Wed Aug 22 16:13:44 2018 +0800

Add the debugging method in spring-demo's document.
---
 saga-demo/saga-spring-demo/README.md | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/saga-demo/saga-spring-demo/README.md 
b/saga-demo/saga-spring-demo/README.md
index a5c7b5a..0502493 100644
--- a/saga-demo/saga-spring-demo/README.md
+++ b/saga-demo/saga-spring-demo/README.md
@@ -125,3 +125,21 @@ The second car booking will be marked with **cancel:true**
 Open a browser with URL http://127.0.0.1:8083, You will get a html page. You 
can use this page to invoke test cases, and then get results.
 
 **Note** transactions and compensations implemented by services must be 
idempotent.
+
+## Debugging
+
+To debug the services of the demo, just add debug parameter to JVM through the 
environment field in docker-compose configs. Let's take alpha-server as an 
example:
+
+```yaml
+alpha:
+  image: "alpha-server:${TAG}"
+  environment:
+- JAVA_OPTS=-Dspring.profiles.active=prd 
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
+  ports:
+- "6006:5005"
+...
+```
+
+We append the debug parameter 
`-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005` to the 
JAVA_OPTS environment variable, the Java process inside the container will 
listen on port 5005. With the port forwarding rule `6006:5005`, when 
alpha-server is ready, we can connect to port 6006 on the host and start 
debugging alpha-server.
+
+If  you're using [IntelliJ](https://www.jetbrains.com/idea/), open the saga 
project, create a new debug configuration with template 'Remote', fill "Host" 
and "Port" input with "localhost" and "6006", then select "alpha" in the 
drop-down list of "Use classpath of module". When alpha-server is running, hit 
shift+f9 to debug the remote application.



[incubator-servicecomb-saga] 07/08: SCB-818 Omega supports of TCC (WIP)

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

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

commit 0cc9678d4950062ed04bccef4eeea3b71d570564
Author: Willem Jiang 
AuthorDate: Tue Aug 21 10:25:13 2018 +0800

SCB-818 Omega supports of TCC (WIP)
---
 .../omega/transaction/tcc/TccEventService.java | 25 -
 .../transaction/tcc/TccParticipatorAspect.java | 14 ++--
 .../tcc/TccStartAnnotationProcessor.java   | 26 ++
 .../saga/omega/transaction/tcc/TccStartAspect.java |  4 ++--
 .../transaction/tcc/events/ParticipatedEvent.java  | 10 ++---
 .../transaction/tcc/events/TccEndedEvent.java  |  4 ++--
 .../transaction/tcc/events/TccStartedEvent.java|  4 ++--
 7 files changed, 61 insertions(+), 26 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
index 1649620..ae011bc 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -1,4 +1,27 @@
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
-public class TccService {
+import org.apache.servicecomb.saga.omega.transaction.AlphaResponse;
+import org.apache.servicecomb.saga.omega.transaction.TxEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
+import org.apache.servicecomb.saga.omega.transaction.tcc.events.TccEndedEvent;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.TccStartedEvent;
+
+public interface TccEventService {
+
+  void onConnected();
+
+  void onDisconnected();
+
+  void close();
+
+  String target();
+
+  AlphaResponse participate(ParticipatedEvent participateEvent);
+
+  AlphaResponse TccTransactionStart(TccStartedEvent tccStartEvent);
+
+  AlphaResponse TccTransactionStop(TccEndedEvent tccEndEvent);
+
+  AlphaResponse send(TxEvent event);
+  
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
index 02adac2..e64bc2a 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java
@@ -20,6 +20,7 @@ package org.apache.servicecomb.saga.omega.transaction.tcc;
 import java.lang.invoke.MethodHandles;
 import java.lang.reflect.Method;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
 import org.apache.servicecomb.saga.omega.context.OmegaContext;
 import org.apache.servicecomb.saga.omega.transaction.MessageSender;
 import org.apache.servicecomb.saga.omega.transaction.OmegaException;
@@ -27,6 +28,7 @@ import 
org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
 import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicyFactory;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
 import org.apache.servicecomb.saga.omega.transaction.annotations.Participate;
+import 
org.apache.servicecomb.saga.omega.transaction.tcc.events.ParticipatedEvent;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
 import org.aspectj.lang.annotation.Aspect;
@@ -39,9 +41,11 @@ public class TccParticipatorAspect {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
   private final OmegaContext context;
+  private final TccEventService tccEventService;
 
-  public TccParticipatorAspect(MessageSender sender, OmegaContext context) {
+  public TccParticipatorAspect(TccEventService tccEventService, OmegaContext 
context) {
 this.context = context;
+this.tccEventService = tccEventService;
   }
 
   
@Around("execution(@org.apache.servicecomb.saga.omega.transaction.annotations.Participate
 * *(..)) && @annotation(participate)")
@@ -49,6 +53,7 @@ public class TccParticipatorAspect {
 Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
 String localTxId = context.localTxId();
 String cancelMethod = participate.cancelMethod();
+String confirmMethod = participate.confirmMethod();
 
 context.newLocalTxId();
 LOG.debug("Updated context {} for participate method {} ", context, 
method.toString());
@@ -56,13 +61,18 @@ public class TccParticipatorAspect {
 try {
   Object result = joinPoint.proceed();
   // Send the participate message back
+  tcc

[incubator-servicecomb-saga] 03/08: SCB-817 Updated the pack-contracts protocal for TCC

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

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

commit 258c2de5189d002ff4ee6dc2be5ac4fd1bb3472b
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:52:19 2018 +0800

SCB-817 Updated the pack-contracts protocal for TCC
---
 .../proto/{GrpcTxEvent.proto => GrpcCommon.proto}  | 33 +
 .../{GrpcTxEvent.proto => GrpcTccEvent.proto}  | 43 --
 .../src/main/proto/GrpcTxEvent.proto   | 11 +-
 3 files changed, 26 insertions(+), 61 deletions(-)

diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
similarity index 58%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
index d2c6f77..40a8db7 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
@@ -19,15 +19,8 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
-  }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
-  rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
-  }
-}
+// Define the common structs which could be use for TccEventService and 
SagaEventService
 
 message GrpcServiceConfig {
   string serviceName = 1;
@@ -37,27 +30,3 @@ message GrpcServiceConfig {
 message GrpcAck {
   bool aborted = 1;
 }
-
-message GrpcTxEvent {
-  int64 timestamp = 1;
-  string globalTxId = 2;
-  string localTxId = 3;
-  string parentTxId = 4;
-  string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
-}
-
-message GrpcCompensateCommand {
-  string globalTxId = 1;
-  string localTxId = 2;
-  string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
-}
-
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
similarity index 60%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index d2c6f77..1eba5e5 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -19,45 +19,48 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
+option java_outer_classname = "TccEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
+import "GrpcCommon.proto";
+
+service TccEventService {
+  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
   }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
+  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
+  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcServiceConfig {
-  string serviceName = 1;
-  string instanceId = 2;
+message GrpcTransactionStartedEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
 }
 
-message GrpcAck {
-  bool aborted = 1;
+message GrpcParticipateEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
+  string confirmMethod = 6;
+  string cancelMethod = 7;
 }
 
-message GrpcTxEvent {
+message GrpcTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
   string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
 }
 
-message GrpcCompensateCommand {
+message GrpcCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
+  string type = 4;
 }
 
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
index d2c6f77..f037b4f 100644
--- a/pack-contracts/pack-

[incubator-servicecomb-saga] 01/08: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit f8cd69c9acd709426d320e61fb37f6a3c6a6c99b
Author: Willem Jiang 
AuthorDate: Sun Aug 12 11:16:22 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   | 15 +
 .../saga/omega/transaction/annotations/TCC.java| 64 ++
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 ++
 .../tcc/TccStartAnnotationProcessor.java   | 47 
 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 +++
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++
 .../transaction/tcc/events/ParticipateEvent.java   | 21 +++
 .../tcc/events/TransactionEndEvent.java|  4 ++
 .../tcc/events/TransationStartEvent.java   |  4 ++
 11 files changed, 307 insertions(+)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
new file mode 100644
index 000..c9154f9
--- /dev/null
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -0,0 +1,15 @@
+package org.apache.servicecomb.saga.omega.context.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates the annotated method will start a TCC .
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface TccStart {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
new file mode 100644
index 000..a095978
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.omega.transaction.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+/**
+ * Indicates the annotated method will start a sub-transaction. 
+ * A @TCC method should satisfy below requirements:
+ * 
+ *   all parameters are serialized
+ *   is idempotent
+ *   the object instance which @TCC method resides in should be 
stateless
+ * 
+ */
+public @interface TCC {
+  /**
+   * Confirm method name.
+   * A confirm method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String confirmMethod() default "";
+
+  /**
+   * Cancel method name.
+   * A cancel method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String cancelMethod() default "";
+
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
new file mode 100644
index 000..173cb78
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
@@ -0,0 +1,48 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+import java.lang.invoke.MethodH

[incubator-servicecomb-saga] 06/08: SCB-817 Updated the TCC grpc contract file

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

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

commit d067ce707b643751dde09dc0530fb76235d2370b
Author: Willem Jiang 
AuthorDate: Tue Aug 21 09:59:02 2018 +0800

SCB-817 Updated the TCC grpc contract file
---
 .../omega/transaction/tcc/TccEventService.java |  4 
 .../{TccStartEvent.java => ParticipatedEvent.java} | 22 +-
 .../{TccEndEvent.java => TccEndedEvent.java}   |  9 ++---
 .../{TccStartEvent.java => TccStartedEvent.java}   |  9 +++--
 .../servicecomb/saga/common/TransactionStatus.java |  6 --
 .../src/main/proto/GrpcTccEvent.proto  |  3 ++-
 6 files changed, 28 insertions(+), 25 deletions(-)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
new file mode 100644
index 000..1649620
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccEventService.java
@@ -0,0 +1,4 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+public class TccService {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
similarity index 77%
copy from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
copy to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
index 416c182..73ede9c 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/ParticipatedEvent.java
@@ -16,26 +16,22 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
-public class TccStartEvent {
+
+public class ParticipateEvent {
+  
   private final String globalTxId;
   private final String localTxId;
   private final String parentTxId;
+  private final String confirmMethod;
+  private final String cancelMethod;
 
-  public String getGlobalTxId() {
-return globalTxId;
-  }
-
-  public String getLocalTxId() {
-return localTxId;
-  }
-
-  public String getParentTxId() {
-return parentTxId;
-  }
 
-  public TccStartEvent(String globalTxId, String localTxId, String parentTxId) 
{
+  public ParticipateEvent(String globalTxId, String localTxId, String 
parentTxId, String confirmMethod,
+  String cancelMethod) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
 this.parentTxId = parentTxId;
+this.confirmMethod = confirmMethod;
+this.cancelMethod = cancelMethod;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
similarity index 82%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
index 541489f..9107ab0 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndedEvent.java
@@ -16,15 +16,18 @@
  */
 package org.apache.servicecomb.saga.omega.transaction.tcc.events;
 
+import org.apache.servicecomb.saga.common.TransactionStatus;
+
 public class TccEndEvent {
   private final String globalTxId;
   private final String localTxId;
-  private final String parentTxId;
+  private final TransactionStatus status;

 
-  public TccEndEvent(String globalTxId, String localTxId, String parentTxId) {
+  public TccEndEvent(String globalTxId, String localTxId,
+  TransactionStatus status) {
 this.globalTxId = globalTxId;
 this.localTxId = localTxId;
-this.parentTxId = parentTxId;
+this.status = status;
   }
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartedEvent.java
similarity index 84%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccStartEvent.java
rename to 
omega/omega-transaction/src/main/java/org/apache/service

[incubator-servicecomb-saga] 05/08: SCB-817 Updated the grpc file of TccEventService

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

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

commit a46088784c43c5d3790bcb1fd886d476d00ad3c4
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:10:07 2018 +0800

SCB-817 Updated the grpc file of TccEventService
---
 .../src/main/proto/GrpcTccEvent.proto  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index 1eba5e5..9e1752f 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto";
 import "GrpcCommon.proto";
 
 service TccEventService {
-  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) 
{
   }
-  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
-  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
+  rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {}
+  rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns 
(GrpcAck) {}
+  rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcTransactionStartedEvent {
+message GrpcTccTransactionStartedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
 }
 
-message GrpcParticipateEvent {
+message GrpcTccParticipateEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -49,7 +49,7 @@ message GrpcParticipateEvent {
   string cancelMethod = 7;
 }
 
-message GrpcTransactionEndedEvent {
+message GrpcTccTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent {
   string type = 5;
 }
 
-message GrpcCordinateCommand {
+message GrpcTccCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string type = 4;
+  string method = 4;
 }
 



[incubator-servicecomb-saga] 08/08: SCB-817 Updated the pack-contracts protocal for TCC

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

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

commit 07af5366b087f6012adf6f1713cbeecbdadc8393
Author: Willem Jiang 
AuthorDate: Wed Aug 22 16:52:24 2018 +0800

SCB-817 Updated the pack-contracts protocal for TCC
---
 .../src/main/proto/GrpcTccEvent.proto   | 21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git 
a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index 14801b2..f482a93 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -26,7 +26,7 @@ import "GrpcCommon.proto";
 service TccEventService {
   rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) 
{
   }
-  rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {}
+  rpc participate(GrpcTccParticipatedEvent) returns (GrpcAck) {}
   rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns 
(GrpcAck) {}
   rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
@@ -38,16 +38,20 @@ message GrpcTccTransactionStartedEvent {
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
+  string serviceName = 5;
+  string instanceId = 6;
 }
 
-message GrpcTccParticipateEvent {
+message GrpcTccParticipatedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
-  string confirmMethod = 6;
-  string cancelMethod = 7;
-  string status = 8;
+  string serviceName = 5;
+  string instanceId = 6;
+  string confirmMethod = 7;
+  string cancelMethod = 8;
+  string status = 9;
 }
 
 message GrpcTccTransactionEndedEvent {
@@ -55,13 +59,16 @@ message GrpcTccTransactionEndedEvent {
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
-  string status = 5;
+  string serviceName = 5;
+  string instanceId = 6;
+  string status = 7;
 }
 
 message GrpcTccCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string method = 4;
+  string serviceName = 4;
+  string method = 5;
 }
 



[incubator-servicecomb-saga] 03/03: SCB-867 Add test for SQL Jackson format

2018-08-24 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 95be0967a837db70bc623462162c3495b05ae2c2
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:20:48 2018 +0800

SCB-867 Add test for SQL Jackson format
---
 .../format/JacksonFromJsonFormatForSQLTest.java| 212 +
 .../saga/format/JsonSQLSagaRequestTest.java|  72 +++
 2 files changed, 284 insertions(+)

diff --git 
a/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
new file mode 100644
index 000..ef40d17
--- /dev/null
+++ 
b/saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.saga.format;
+
+import static com.seanyinx.github.unit.scaffolding.Randomness.uniquify;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.servicecomb.saga.core.Operation;
+import org.apache.servicecomb.saga.core.SagaDefinition;
+import org.apache.servicecomb.saga.core.SagaException;
+import org.apache.servicecomb.saga.core.SagaRequest;
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.core.SuccessfulSagaResponse;
+import org.apache.servicecomb.saga.core.application.interpreter.FromJsonFormat;
+import org.apache.servicecomb.saga.transports.SQLTransport;
+import org.apache.servicecomb.saga.transports.TransportFactory;
+import org.junit.Test;
+
+import com.seanyinx.github.unit.scaffolding.AssertUtils;
+
+public class JacksonFromJsonFormatForSQLTest {
+  private static final String requestJson = "{\n"
+  + "\"requests\":[\n"
+  + "{\n"
+  + "\"id\":\"first-sql-sharding-1\",\n"
+  + "\"type\":\"sql\",\n"
+  + "\"datasource\":\"ds_0\",\n"
+  + "\"parents\":[],\n"
+  + "\"transaction\":{\n"
+  + "\"sql\":\"INSERT INTO TABLE ds_0.tb_0 (id, value) 
values (?, ?)\",\n"
+  + "\"params\":[\"1\", \"xxx\"]\n"
+  + "},\n"
+  + "\"compensation\":{\n"
+  + "\"sql\":\"DELETE FROM ds_0.tb_0 WHERE id=?\",\n"
+  + "\"params\":[\"1\"]\n"
+  + "}\n"
+  + "},\n"
+  + "{\n"
+  + "\"id\":\"first-sql-sharding-2\",\n"
+  + "\"type\":\"sql\",\n"
+  + "\"datasource\":\"ds_0\",\n"
+  + "\"parents\":[],\n"
+  + "\"transaction\":{\n"
+  + "\"sql\":\"INSERT INTO TABLE ds_0.tb_1 (id, value) 
values (?, ?)\",\n"
+  + "\"params\":[\"2\", \"xxx\"]\n"
+  + "},\n"
+  + "\"compensation\":{\n"
+  + "\"sql\":\"DELETE FROM ds_0.tb_1 WHERE id=?\",\n"
+  + "\"params\":[\"2\"]\n"
+  + "}\n"
+  + "},\n"
+  + &q

[incubator-servicecomb-saga] 02/03: SCB-867 Add SQL type Jackson format

2018-08-24 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 e38d1b769c6c40713a558f969a70ce4e01385839
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:20:05 2018 +0800

SCB-867 Add SQL type Jackson format
---
 ...agaRequest.java => JacksonSQLCompensation.java} | 48 ---
 ...onSagaRequest.java => JacksonSQLOperation.java} | 43 --
 ...SagaRequest.java => JacksonSQLTransaction.java} | 29 -
 .../saga/format/JsonSQLSagaRequest.java| 69 ++
 .../servicecomb/saga/format/JsonSagaRequest.java   |  3 +-
 5 files changed, 137 insertions(+), 55 deletions(-)

diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
similarity index 53%
copy from 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
copy to 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
index a25542f..6a61bf3 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLCompensation.java
@@ -17,24 +17,32 @@
 
 package org.apache.servicecomb.saga.format;
 
-import org.apache.servicecomb.saga.core.Operation;
-import org.apache.servicecomb.saga.core.SagaRequest;
-import org.apache.servicecomb.saga.core.Transport;
-import org.apache.servicecomb.saga.transports.TransportFactory;
-
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-@JsonTypeInfo(
-use = JsonTypeInfo.Id.NAME,
-include = JsonTypeInfo.As.PROPERTY,
-visible = true,
-property = "type")
-@JsonSubTypes({
-@Type(value = JsonRestSagaRequest.class, name = Operation.TYPE_REST)
-})
-public interface JsonSagaRequest extends SagaRequest {
-
-  JsonSagaRequest with(TransportFactory transportFactory);
+import java.util.List;
+
+import org.apache.servicecomb.saga.core.Compensation;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class JacksonSQLCompensation extends JacksonSQLOperation implements 
Compensation {
+
+  private final int retries;
+
+  public JacksonSQLCompensation(String sql, List params) {
+this(sql, params, DEFAULT_RETRIES);
+  }
+
+  @JsonCreator
+  public JacksonSQLCompensation(
+  @JsonProperty("sql") String sql,
+  @JsonProperty("params") List params,
+  @JsonProperty("retries") int retries) {
+super(sql, params);
+this.retries = retries <= 0? DEFAULT_RETRIES : retries;
+  }
+
+  @Override
+  public int retries() {
+return this.retries;
+  }
 }
diff --git 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
similarity index 56%
copy from 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
copy to 
saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
index a25542f..500bdfd 100644
--- 
a/saga-format/src/main/java/org/apache/servicecomb/saga/format/JsonSagaRequest.java
+++ 
b/saga-format/src/main/java/org/apache/servicecomb/saga/format/JacksonSQLOperation.java
@@ -17,24 +17,33 @@
 
 package org.apache.servicecomb.saga.format;
 
+import java.util.List;
+
 import org.apache.servicecomb.saga.core.Operation;
-import org.apache.servicecomb.saga.core.SagaRequest;
-import org.apache.servicecomb.saga.core.Transport;
+import org.apache.servicecomb.saga.core.SQLOperation;
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.transports.SQLTransport;
 import org.apache.servicecomb.saga.transports.TransportFactory;
 
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-@JsonTypeInfo(
-use = JsonTypeInfo.Id.NAME,
-include = JsonTypeInfo.As.PROPERTY,
-visible = true,
-property = "type")
-@JsonSubTypes({
-@Type(value = JsonRestSagaRequest.class, name = Operation.TYPE_REST)
-})
-public interface JsonSagaRequest extends SagaRequest {
-
-  JsonSagaRequest with(TransportFactory transportFactory);
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class JacksonSQLOperation extends SQLOperation implements 
TransportAware {
+
+  @JsonIgnore
+  private SQLTransport transport;
+
+  public JacksonSQLOperation(String sql, List params) {
+super(sql, params);
+  }
+
+  @Override
+  public Operation with(Transp

[incubator-servicecomb-saga] 01/03: SCB-866 extend SQLTransport type

2018-08-24 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 22082fece5243be6b65499552089913cff2d9bb0
Author: KomachiSion <263976...@qq.com>
AuthorDate: Fri Aug 24 11:19:17 2018 +0800

SCB-866 extend SQLTransport type
---
 .../apache/servicecomb/saga/core/Operation.java|  1 +
 .../core/{Operation.java => SQLOperation.java} | 41 ++
 .../SQLTransport.java} | 14 
 3 files changed, 43 insertions(+), 13 deletions(-)

diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
index 99e760b..5950865 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
@@ -21,6 +21,7 @@ public interface Operation {
 
   String TYPE_NOP = "NOP";
   String TYPE_REST = "rest";
+  String TYPE_SQL = "sql";
   SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
 
   SagaResponse send(String address);
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
similarity index 51%
copy from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
copy to 
saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
index 99e760b..6444e2b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/SQLOperation.java
@@ -17,13 +17,42 @@
 
 package org.apache.servicecomb.saga.core;
 
-public interface Operation {
+import java.util.Collections;
+import java.util.List;
 
-  String TYPE_NOP = "NOP";
-  String TYPE_REST = "rest";
-  SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
+public class SQLOperation implements Operation {
 
-  SagaResponse send(String address);
+  private final String sql;
+  private final List params;
 
-  SagaResponse send(String address, SagaResponse response);
+  public SQLOperation(String sql, List params) {
+this.sql = sql;
+this.params = params == null ? Collections.emptyList() : params;
+  }
+
+  public String sql() {
+return sql;
+  }
+
+  public List params() {
+return params;
+  }
+
+  @Override
+  public String toString() {
+return "SQLOperation{" +
+"sql='" + sql + '\'' +
+", params=" + params +
+'}';
+  }
+
+  @Override
+  public SagaResponse send(String datasource) {
+return SUCCESSFUL_SAGA_RESPONSE;
+  }
+
+  @Override
+  public SagaResponse send(String datasource, SagaResponse response) {
+return send(datasource);
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
similarity index 72%
copy from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
copy to 
saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
index 99e760b..6e534dd 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Operation.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/transports/SQLTransport.java
@@ -15,15 +15,15 @@
  * limitations under the License.
  */
 
-package org.apache.servicecomb.saga.core;
+package org.apache.servicecomb.saga.transports;
 
-public interface Operation {
+import java.util.List;
 
-  String TYPE_NOP = "NOP";
-  String TYPE_REST = "rest";
-  SagaResponse SUCCESSFUL_SAGA_RESPONSE = new 
SuccessfulSagaResponse("success");
+import org.apache.servicecomb.saga.core.SagaResponse;
+import org.apache.servicecomb.saga.core.Transport;
 
-  SagaResponse send(String address);
+public interface SQLTransport extends Transport {
+
+  SagaResponse with(String datasource, String sql, List params);
 
-  SagaResponse send(String address, SagaResponse response);
 }



[incubator-servicecomb-saga] branch master updated (6dee598 -> 95be096)

2018-08-24 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 6dee598  SCB-817 Added the unit tests of TCC related Aspect
 new 22082fe  SCB-866 extend SQLTransport type
 new e38d1b7  SCB-867 Add SQL type Jackson format
 new 95be096  SCB-867 Add test for SQL Jackson format

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


Summary of changes:
 .../apache/servicecomb/saga/core/Operation.java|   1 +
 ...ccessfulSagaResponse.java => SQLOperation.java} |  39 ++--
 .../{RestTransport.java => SQLTransport.java}  |   8 +-
 ...mpensation.java => JacksonSQLCompensation.java} |  28 ++-
 ...onSagaRequest.java => JacksonSQLOperation.java} |  43 +++--
 ...Transaction.java => JacksonSQLTransaction.java} |  17 +-
 ...estSagaRequest.java => JsonSQLSagaRequest.java} |  28 ++-
 .../servicecomb/saga/format/JsonSagaRequest.java   |   3 +-
 .../format/JacksonFromJsonFormatForSQLTest.java| 212 +
 ...equestTest.java => JsonSQLSagaRequestTest.java} |  43 +
 10 files changed, 312 insertions(+), 110 deletions(-)
 copy 
saga-core/src/main/java/org/apache/servicecomb/saga/core/{SuccessfulSagaResponse.java
 => SQLOperation.java} (57%)
 copy 
saga-core/src/main/java/org/apache/servicecomb/saga/transports/{RestTransport.java
 => SQLTransport.java} (84%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JacksonRestCompensation.java
 => JacksonSQLCompensation.java} (67%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JsonSagaRequest.java
 => JacksonSQLOperation.java} (56%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JacksonRestTransaction.java
 => JacksonSQLTransaction.java} (75%)
 copy 
saga-format/src/main/java/org/apache/servicecomb/saga/format/{JsonRestSagaRequest.java
 => JsonSQLSagaRequest.java} (73%)
 create mode 100644 
saga-format/src/test/java/org/apache/servicecomb/saga/format/JacksonFromJsonFormatForSQLTest.java
 copy 
saga-format/src/test/java/org/apache/servicecomb/saga/format/{JsonRestSagaRequestTest.java
 => JsonSQLSagaRequestTest.java} (59%)



[incubator-servicecomb-docs] branch master updated (1ed6c8b -> ef2340c)

2018-08-28 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-docs.git.


from 1ed6c8b  update java-chassis-reference/en_US/SUMMARY.md
 new bd87f24  update java-chassis-reference/en_US/security/rsa.md
 new ef2340c  update java-chassis-reference/en_US/security/tls.md

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:
 java-chassis-reference/en_US/security/rsa.md   | 54 
 .../en_US/security/shi-yong-rsa-ren-zheng.md   | 54 
 java-chassis-reference/en_US/security/tls.md   | 95 +++---
 3 files changed, 101 insertions(+), 102 deletions(-)
 create mode 100755 java-chassis-reference/en_US/security/rsa.md
 delete mode 100644 
java-chassis-reference/en_US/security/shi-yong-rsa-ren-zheng.md
 mode change 100644 => 100755 java-chassis-reference/en_US/security/tls.md



[incubator-servicecomb-docs] 01/02: update java-chassis-reference/en_US/security/rsa.md

2018-08-28 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-docs.git

commit bd87f24daf23e17c1391209e40ecbcecbf0e51c0
Author: DeanLee 
AuthorDate: Tue Aug 28 11:38:47 2018 +0800

update java-chassis-reference/en_US/security/rsa.md
---
 java-chassis-reference/en_US/security/rsa.md   | 54 ++
 .../en_US/security/shi-yong-rsa-ren-zheng.md   | 54 --
 2 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/java-chassis-reference/en_US/security/rsa.md 
b/java-chassis-reference/en_US/security/rsa.md
new file mode 100755
index 000..9e9fb68
--- /dev/null
+++ b/java-chassis-reference/en_US/security/rsa.md
@@ -0,0 +1,54 @@
+## Scene Description
+
+Users can enable RSA authentication between services through simple 
configuration to ensure the security of the service interface.
+
+Detailed introduction [public key authentication] 
(../references-handlers/publickey.md)
+
+## Consumer Configuration
+
+* Add dependencies in pom.xml:
+
+  ```
+   
+  org.apache.servicecomb
+  handler-publickey-auth
+
+  ```
+
+* Added to the processing chain in microservice.yaml
+
+  ```
+  servicecomb:
+   ..
+   handler:
+chain:
+ Consumer:
+  default: auth-consumer
+   ..
+  ```
+
+## Provider Configuration
+
+* Add dependencies in pom.xml:
+
+  ```
+   
+  org.apache.servicecomb
+  handler-publickey-auth
+
+  ```
+
+* Added to the processing chain in microservice.yaml
+
+  ```
+  servicecomb:
+   ..
+   handler:
+chain:
+ Provider:
+  default: auth-provider
+   ..
+  ```
+
+
+
diff --git a/java-chassis-reference/en_US/security/shi-yong-rsa-ren-zheng.md 
b/java-chassis-reference/en_US/security/shi-yong-rsa-ren-zheng.md
deleted file mode 100644
index e66d2a2..000
--- a/java-chassis-reference/en_US/security/shi-yong-rsa-ren-zheng.md
+++ /dev/null
@@ -1,54 +0,0 @@
-## 场景描述
-
-用户通过简单的配置即可启用服务间RSA认证,以保障服务接口的安全性。
-
-详细介绍参考[公钥认证](../references-handlers/publickey.md)
-
-## Consumer配置
-
-* 在pom.xml中增加依赖:
-
-  ```
-
-  org.apache.servicecomb 
-  handler-publickey-auth 
-
-  ```
-
-* 在microservice.yaml中添加进处理链
-
-  ```
-  servicecomb:
-   ..
-   handler:
-chain:
- Consumer:
-  default: auth-consumer
-   ..
-  ```
-
-## Provider配置
-
-* 在pom.xml中增加依赖:
-
-  ```
-
-  org.apache.servicecomb 
-  handler-publickey-auth 
-
-  ```
-
-* 在microservice.yaml中添加进处理链
-
-  ```
-  servicecomb:
-   ..
-   handler:
-chain:
- Provider:
-  default: auth-provider
-   ..
-  ```
-
-
-



[incubator-servicecomb-docs] 02/02: update java-chassis-reference/en_US/security/tls.md

2018-08-28 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-docs.git

commit ef2340c8a465b99f46910f6789c199af322c0bea
Author: DeanLee 
AuthorDate: Tue Aug 28 11:38:58 2018 +0800

update java-chassis-reference/en_US/security/tls.md
---
 java-chassis-reference/en_US/security/tls.md | 95 ++--
 1 file changed, 47 insertions(+), 48 deletions(-)

diff --git a/java-chassis-reference/en_US/security/tls.md 
b/java-chassis-reference/en_US/security/tls.md
old mode 100644
new mode 100755
index 0c4fa6d..22bfae6
--- a/java-chassis-reference/en_US/security/tls.md
+++ b/java-chassis-reference/en_US/security/tls.md
@@ -1,13 +1,13 @@
-## 场景描述
+## Scene Description
 
-用户通过简单的配置即可启用TLS通信,以保障数据的传输安全。
+Users can enable TLS communication through simple configuration to ensure data 
transmission security.
 
-## 外部服务通信配置
+## External Service Communication Configuration
 
-与外部服务通信相关的配置写在microservice.yaml文件中。
+The configuration related to external service communication is written in the 
microservice.yaml file.
 
-* 服务中心、配置中心TLS通信配置  
-  微服务与服务中心、配置中心的连接可以通过将http改为https启用TLS通信,配置示例如下:
+* Service Center, Configuration Center TLS communication configuration
+   The connection between the microservices and the service center and the 
configuration center can be enabled by changing http to https. The 
configuration example is as follows:
 
   ```yaml
   servicecomb:
@@ -19,8 +19,8 @@
 serverUri: https://127.0.0.1:30103
   ```
 
-* 服务提供者启用TLS通信  
-  服务提供者在配置服务监听地址时,可以通过在地址后面追加`?sslEnabled=true`开启TLS通信,示例如下:
+* Service provider enables TLS communication
+   When the service provider configures the service listening address, it can 
open TLS communication by appending `?sslEnabled=true` to the address. The 
example is as follows:
 
   ```yaml
   servicecomb:
@@ -30,54 +30,56 @@
   address: 0.0.0.0:7070?sslEnabled=true
   ```
 
-## 证书配置
+## Certificate Configuration
 
-证书配置项写在microservice.yaml文件中,支持统一制定证书,也可以添加tag进行更细粒度的配置,有tag的配置会覆盖全局配置,配置格式如下:
+The certificate configuration item is written in the microservice.yaml file. 
It supports the unified development of certificates. It can also add tags for 
finer-grained configuration. The tag configuration overrides the global 
configuration. The configuration format is as follows:
 
 ```
 ssl.[tag].[property]
 ```
-常见的tag如下表:   
+The common tags are as follows:
 
-| 项目 | tag |
+| Project | tag |
 | :--- | :--- |
-| 服务中心 | sc.consumer |
-| 配置中心 | cc.consumer |
-| 看板中心 | mc.consumer |
-| Rest服务端 | rest.provider |
-| Highway服务端 | highway.provider |
-| Rest客户端 | rest.consumer|
-| Highway客户端 | highway.consumer|
-| auth客户端 | apiserver.consumer|
-一般不需要配置tag,正常情况分为三类:1、连接内部服务 2、作为服务端 3、作为客户端 所以如果这三类要求的证书不一致,那么需要使用tag来区分
-
-证书配置项见表1 证书配置项说明表。  
-**表1 证书配置项说明表**
-
-| 配置项 | 默认值 | 取值范围 | 是否必选 | 含义 | 注意 |
+| Service Center | sc.consumer |
+| Configuration Center | cc.consumer |
+| Kanban Center | mc.consumer |
+| Rest server | rest.provider |
+| Highway Server | highway.provider |
+| Rest client | rest.consumer|
+| Highway Client | highway.consumer|
+| auth client | apiserver.consumer|
+Generally, there is no need to configure tags. The normal situation is divided 
into three categories: 1. Connecting internal services 2. As a server 3. As a 
client, if the certificates required by these three types are inconsistent, 
then you need to use tags to distinguish
+
+The certificate configuration items are shown in Table 1. Certificate 
Configuration Item Description Table.
+**Table 1 Certificate Configuration Item Description Table**
+
+| Configuration Item | Default Value | Range of Value | Required | Meaning |
 | :--- | :--- | :--- | :--- | :--- | :--- |
-| ssl.engine| jdk | - | 否 | ssl协议,提供jdk/openssl选择 | 默认为jdk |
-| ssl.protocols | TLSv1.2 | - | 否 | 协议列表 | 使用逗号分隔 |
-| ssl.ciphers | 
TLS\_ECDHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384,TLS\_RSA\_WITH\_AES\_256\_GCM\_SHA384,TLS\_ECDHE\_RSA\_WITH\_AES\_128\_GCM\_SHA256,TLS\_RSA\_WITH\_AES\_128\_GCM\_SHA256
 | - | 否 | 算法列表 | 使用逗号分隔 |
-| ssl.authPeer | true | - | 否 | 是否认证对端 | - |
-| ssl.checkCN.host | true | - | 否 | 是否对证书的CN进行检查 | 
该配置项只对Consumer端,并且使用http协议有效,即Consumser端使用rest通道有效。对于Provider端、highway通道等无效。检查CN的目的是防止服务器被钓鱼,参考标准定义:[https://tools.ietf.org/html/rfc2818。](https://tools.ietf.org/html/rfc2818。)
 |
-| ssl.trustStore | trust.jks | - | 否 | 信任证书文件 | - |
-| ssl.trustStoreType | JKS | - | 否 | 信任证书类型 | - |
-| ssl.trustStoreValue | - | - | 否 | 信任证书密码 | - |
-| ssl.keyStore | server.p12 | - | 否 | 身份证书文件 | - |
-| ssl.keyStoreType | PKCS12 | - | 否 | 身份证书类型 | - |
-| ssl.keyStoreValue | - | - | 否 | 身份证书密码 | - |
-| ssl.crl | revoke.crl | - | 否 | 吊销证书文件 | - |
-| ssl.sslCustomClass | - | org.apache.servicecomb.foundation.ssl.SSLCustom的实现类 
| 否 | SSLCustom类的实现,用于开发者转换密码、文件路径等。 | - |
-
-> **说明**:
+Ssl.engine| jdk | - | No | ssl protocol, provide jdk/openssl options | default 
jdk |
+| ssl.protocols | TLSv

[incubator-servicecomb-docs] branch master updated: saga docs fix issue (#58)

2018-08-28 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-docs.git


The following commit(s) were added to refs/heads/master by this push:
 new 58b0b94  saga docs fix issue (#58)
58b0b94 is described below

commit 58b0b943e0b14286442f6da43549eb2929ec4af2
Author: lidian 
AuthorDate: Tue Aug 28 18:36:37 2018 +0800

saga docs fix issue (#58)

* add book.json for service center index

* add book.json for service center index

* update ../saga-reference/zh_CN/SUMMARY.md index

* update readme of service center content

* update zh_CN/security-tls.md translation

* update dev-guide link

* cancel link of ../saga-reference/

* update summary formart

* translate service-center-reference/zh_CN/sc-cluster.md to cn
---
 saga-reference/en_US/README.md |  2 --
 saga-reference/en_US/SUMMARY.md|  4 +---
 saga-reference/en_US/design.md |  1 -
 saga-reference/en_US/user_guide.md |  2 --
 saga-reference/zh_CN/README.md |  2 --
 saga-reference/zh_CN/SUMMARY.md|  7 ++
 saga-reference/zh_CN/design_zh.md  |  1 -
 saga-reference/zh_CN/user_guide_zh.md  |  2 --
 service-center-reference/en_US/README.md   | 30 -
 service-center-reference/en_US/SUMMARY.md  |  2 +-
 service-center-reference/{ => en_US}/book.json |  0
 service-center-reference/en_US/dev-guide.md|  3 +--
 service-center-reference/zh_CN/README.md   | 30 -
 service-center-reference/zh_CN/SUMMARY.md  |  2 +-
 service-center-reference/zh_CN/book.json   |  5 +
 service-center-reference/zh_CN/dev-guide.md|  2 +-
 service-center-reference/zh_CN/sc-cluster.md   | 31 ++
 service-center-reference/zh_CN/security-tls.md | 28 +++
 18 files changed, 92 insertions(+), 62 deletions(-)

diff --git a/saga-reference/en_US/README.md b/saga-reference/en_US/README.md
index 58a2b2b..3965cbd 100644
--- a/saga-reference/en_US/README.md
+++ b/saga-reference/en_US/README.md
@@ -1,6 +1,4 @@
 # Saga User Guide
-[![ZH 
doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md)
-
 ## Prerequisites
 You will need:
 1. [JDK 1.8][jdk]
diff --git a/saga-reference/en_US/SUMMARY.md b/saga-reference/en_US/SUMMARY.md
index 3def406..030ac02 100644
--- a/saga-reference/en_US/SUMMARY.md
+++ b/saga-reference/en_US/SUMMARY.md
@@ -4,6 +4,4 @@
 * [Design](design.md)
 * [TLS](enable_ssl.md)
 * [API](api/api.md)
-* [Q](faq/how_to_use_mysql_as_alpha_backend_database.md)
-
-
+* [Q](faq/how_to_use_mysql_as_alpha_backend_database.md)
\ No newline at end of file
diff --git a/saga-reference/en_US/design.md b/saga-reference/en_US/design.md
index a1e0143..1d7b76a 100644
--- a/saga-reference/en_US/design.md
+++ b/saga-reference/en_US/design.md
@@ -1,5 +1,4 @@
 # Saga Pack Design
-[![ZH doc](https://img.shields.io/badge/document-中文-blue.svg)](design_zh.md)
 ## Overview
 Pack contains two components: *alpha* and *omega*. Alpha is the pack leader 
and backed by database to make sure transaction events stored permanently while 
omega is the pack worker and embedded inside services to intercept transaction 
invocation and report events to alpha.
 
diff --git a/saga-reference/en_US/user_guide.md 
b/saga-reference/en_US/user_guide.md
index 293004b..eecc681 100644
--- a/saga-reference/en_US/user_guide.md
+++ b/saga-reference/en_US/user_guide.md
@@ -1,6 +1,4 @@
 # Saga User Guide
-[![ZH 
doc](https://img.shields.io/badge/document-中文-blue.svg)](user_guide_zh.md)
-
 ## Prerequisites
 You will need:
 1. [JDK 1.8][jdk]
diff --git a/saga-reference/zh_CN/README.md b/saga-reference/zh_CN/README.md
index ba5386e..9a40607 100644
--- a/saga-reference/zh_CN/README.md
+++ b/saga-reference/zh_CN/README.md
@@ -1,6 +1,4 @@
 # Saga 用户指南
-[![EN 
doc](https://img.shields.io/badge/document-English-blue.svg)](user_guide.md)
-
 ## 准备环境
 1. 安装[JDK 1.8][jdk]
 2. 安装[Maven 3.x][maven]
diff --git a/saga-reference/zh_CN/SUMMARY.md b/saga-reference/zh_CN/SUMMARY.md
index d761f77..da33bcc 100644
--- a/saga-reference/zh_CN/SUMMARY.md
+++ b/saga-reference/zh_CN/SUMMARY.md
@@ -1,9 +1,6 @@
 # 目录
-
 * [用户手册](user_guide_zh.md)
-* [设计文档](design.md)
+* [设计文档](design_zh.md)
 * [TLS通信](enable_ssl.md)
 * [API](api/api.md)
-* [Q](faq/how_to_use_mysql_as_alpha_backend_database_zh.md)
-
-
+* [Q](faq/how_to_use_mysql_as_alpha_backend_database_zh.md)
\ No newline at end of file
diff --git a/saga-reference/zh_CN/design_zh.md 
b/saga-reference/zh_CN/design_zh.md
index 7659755..afbb07e 100644
--- a/saga-reference/zh_CN/design_zh.md
+++ b/saga-reference/zh_CN/design_zh.md
@@ -1,5 +1,4 @@
 # Saga Pack 设计文档
-[![EN doc](https://img.shields.io/badge/document-English-blue.svg)](design.md)
 ## 概览
 Pack中包含两个组件,即 **alpha** 和 **om

[incubator-servicecomb-saga] branch master updated: Update the images' tag to 0.3.0-SNAPSHOT in dependency free trans demo

2018-08-28 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 1e32afb  Update the images' tag to 0.3.0-SNAPSHOT in dependency free 
trans demo
1e32afb is described below

commit 1e32afbb17ff47c35a8f112c59b81a2e7d22c3ff
Author: Zhen Ju 
AuthorDate: Wed Aug 29 10:38:56 2018 +0800

Update the images' tag to 0.3.0-SNAPSHOT in dependency free trans demo
---
 .../dependency-free-transaction-demo/docker-compose.yaml | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/saga-demo/dependency-free-transaction-demo/docker-compose.yaml 
b/saga-demo/dependency-free-transaction-demo/docker-compose.yaml
index c6282bf..5bf8660 100755
--- a/saga-demo/dependency-free-transaction-demo/docker-compose.yaml
+++ b/saga-demo/dependency-free-transaction-demo/docker-compose.yaml
@@ -40,7 +40,7 @@ services:
 retries: 5
 
   car-rental-service:
-image: "car-rental-service:0.0.3-SNAPSHOT"
+image: "car-rental-service:0.3.0-SNAPSHOT"
 hostname: car
 links:
   - "service-center:sc.servicecomb.io"
@@ -48,7 +48,7 @@ services:
   - "8080"
 
   flight-booking-service:
-image: "flight-booking-service:0.0.3-SNAPSHOT"
+image: "flight-booking-service:0.3.0-SNAPSHOT"
 hostname: flight
 links:
   - "service-center:sc.servicecomb.io"
@@ -56,7 +56,7 @@ services:
   - "8080"
 
   hotel-reservation-service:
-image: "hotel-reservation-service:0.0.3-SNAPSHOT"
+image: "hotel-reservation-service:0.3.0-SNAPSHOT"
 hostname: hotel
 links:
   - "service-center:sc.servicecomb.io"
@@ -64,7 +64,7 @@ services:
   - "8080"
 
   payment-service:
-image: "payment-service:0.0.3-SNAPSHOT"
+image: "payment-service:0.3.0-SNAPSHOT"
 hostname: payment
 links:
   - "service-center:sc.servicecomb.io"
@@ -72,7 +72,7 @@ services:
   - "8080"
 
   saga:
-image: "saga-spring:0.0.3-SNAPSHOT"
+image: "saga-spring:0.3.0-SNAPSHOT"
 hostname: saga
 links:
   - "postgres:postgres.servicecomb.io"
@@ -90,7 +90,7 @@ services:
 condition: service_healthy
 
   web:
-image: "saga-web:0.0.3-SNAPSHOT"
+image: "saga-web:0.3.0-SNAPSHOT"
 hostname: web
 links:
   - "service-center:sc.servicecomb.io"



[incubator-servicecomb-saga] 01/02: [SCB-868] Add Kamon metrics to Alpha Server

2018-08-28 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 a5c3e3e16bafa25bdd7b0b73a23d970a2ab0d00c
Author: maheshrajus 
AuthorDate: Fri Aug 24 17:58:23 2018 +0530

[SCB-868] Add Kamon metrics to Alpha Server

Add Kamon metrics to Alpha Server:Review comments fix & system metrics 
enabled

Add Kamon metrics to Alpha Server:Review comments fix & System metrics 
enabled
---
 .../servicecomb/saga/alpha/core/EventScanner.java  | 24 +-
 .../saga/alpha/server/AlphaApplication.java|  9 +++
 .../saga/alpha/server/AlphaEventController.java|  6 ++
 .../saga/alpha/server/GrpcTxEventEndpointImpl.java |  6 ++
 .../src/main/resources/META-INF/aop.xml| 25 ++
 .../src/main/resources/application.conf| 88 ++
 alpha/pom.xml  | 46 +++
 saga-spring/pom.xml|  1 +
 8 files changed, 201 insertions(+), 4 deletions(-)

diff --git 
a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/EventScanner.java
 
b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/EventScanner.java
index 298274c..0a15ad0 100644
--- 
a/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/EventScanner.java
+++ 
b/alpha/alpha-core/src/main/java/org/apache/servicecomb/saga/alpha/core/EventScanner.java
@@ -28,21 +28,32 @@ import java.lang.invoke.MethodHandles;
 import java.util.List;
 import java.util.concurrent.ScheduledExecutorService;
 
+import kamon.annotation.EnableKamon;
+import kamon.annotation.Trace;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@EnableKamon
 public class EventScanner implements Runnable {
   private static final Logger LOG = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
   private static final byte[] EMPTY_PAYLOAD = new byte[0];
 
   private final ScheduledExecutorService scheduler;
+
   private final TxEventRepository eventRepository;
+
   private final CommandRepository commandRepository;
+
   private final TxTimeoutRepository timeoutRepository;
+
   private final OmegaCallback omegaCallback;
+
   private final int eventPollingInterval;
 
   private long nextEndedEventId;
+
   private long nextCompensatedEventId;
 
   public EventScanner(ScheduledExecutorService scheduler,
@@ -81,6 +92,7 @@ public class EventScanner implements Runnable {
 MILLISECONDS);
   }
 
+  @Trace("findTimeoutEvents")
   private void findTimeoutEvents() {
 eventRepository.findTimeoutEvents()
 .forEach(event -> {
@@ -93,6 +105,7 @@ public class EventScanner implements Runnable {
 timeoutRepository.markTimeoutAsDone();
   }
 
+  @Trace("saveUncompensatedEventsToCommands")
   private void saveUncompensatedEventsToCommands() {
 
eventRepository.findFirstUncompensatedEventByIdGreaterThan(nextEndedEventId, 
TxEndedEvent.name())
 .forEach(event -> {
@@ -102,6 +115,7 @@ public class EventScanner implements Runnable {
 });
   }
 
+  @Trace("updateCompensationStatus")
   private void updateCompensatedCommands() {
 
eventRepository.findFirstCompensatedEventByIdGreaterThan(nextCompensatedEventId)
 .ifPresent(event -> {
@@ -111,6 +125,7 @@ public class EventScanner implements Runnable {
 });
   }
 
+  @Trace("deleteDuplicateSagaEndedEvents")
   private void deleteDuplicateSagaEndedEvents() {
 try {
   eventRepository.deleteDuplicateEvents(SagaEndedEvent.name());
@@ -128,6 +143,7 @@ public class EventScanner implements Runnable {
 markSagaEnded(event);
   }
 
+  @Trace("abortTimeoutEvents")
   private void abortTimeoutEvents() {
 timeoutRepository.findFirstTimeout().forEach(timeout -> {
   LOG.info("Found timeout event {} to abort", timeout);
@@ -141,6 +157,7 @@ public class EventScanner implements Runnable {
 });
   }
 
+  @Trace("updateTransactionStatus")
   private void updateTransactionStatus() {
 
eventRepository.findFirstAbortedGlobalTransaction().ifPresent(this::markGlobalTxEndWithEvents);
   }
@@ -184,6 +201,7 @@ public class EventScanner implements Runnable {
 EMPTY_PAYLOAD);
   }
 
+  @Trace("compensate")
   private void compensate() {
 commandRepository.findFirstCommandToCompensate()
 .forEach(command -> {
@@ -204,8 +222,7 @@ public class EventScanner implements Runnable {
 command.parentTxId(),
 TxStartedEvent.name(),
 command.compensationMethod(),
-command.payloads()
-);
+command.payloads());
   }
 
   private TxTimeout txTimeoutOf(TxEvent event) {
@@ -218,7 +235,6 @@ public class EventScanner implements Runnable {
 event.parentTxId(),
 event.type(),
 event.expiryTime(),
-NEW.name()
-   

[incubator-servicecomb-saga] 02/02: SCB-868 Clean up the Alpha dependencies

2018-08-28 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 1a95b10273ea6e82e9afb9113645a7e32fbc51d7
Author: Willem Jiang 
AuthorDate: Wed Aug 29 09:14:02 2018 +0800

SCB-868 Clean up the Alpha dependencies
---
 alpha/alpha-core/pom.xml   |  6 +-
 alpha/alpha-server/pom.xml | 35 +++
 alpha/pom.xml  | 45 -
 saga-spring/pom.xml|  1 -
 4 files changed, 40 insertions(+), 47 deletions(-)

diff --git a/alpha/alpha-core/pom.xml b/alpha/alpha-core/pom.xml
index cbd2f56..57c631f 100644
--- a/alpha/alpha-core/pom.xml
+++ b/alpha/alpha-core/pom.xml
@@ -42,7 +42,11 @@
   javax.persistence
   javax.persistence-api
 
-
+
+
+  io.kamon
+  kamon-annotation_2.12
+
 
   org.apache.logging.log4j
   log4j-slf4j-impl
diff --git a/alpha/alpha-server/pom.xml b/alpha/alpha-server/pom.xml
index c4916ee..e26bbcb 100644
--- a/alpha/alpha-server/pom.xml
+++ b/alpha/alpha-server/pom.xml
@@ -110,6 +110,20 @@
   disruptor
 
 
+
+
+  io.kamon
+  kamon-core_2.12
+
+
+  io.kamon
+  kamon-annotation_2.12
+
+
+  com.typesafe.akka
+  akka-actor_2.12
+
+
 
   org.springframework.boot
   spring-boot-starter-test
@@ -205,5 +219,26 @@
 ${spring.boot2.version}
   
 
+
+  perf
+  
+
+  io.kamon
+  kamon-log-reporter_2.12
+
+
+  io.kamon
+  kamon-statsd_2.12
+
+
+  io.kamon
+  kamon-autoweave_2.12
+
+
+  org.aspectj
+  aspectjweaver
+
+  
+
   
 
diff --git a/alpha/pom.xml b/alpha/pom.xml
index 738b956..4e58d97 100644
--- a/alpha/pom.xml
+++ b/alpha/pom.xml
@@ -35,21 +35,6 @@
 alpha-server
   
 
-  
-   
-  io.kamon
-  kamon-core_2.12
-
-
-  io.kamon
-  kamon-annotation_2.12
-
-
-  com.typesafe.akka
-  akka-actor_2.12
-
-  
-
   
 
   
@@ -63,34 +48,4 @@
 
   
 
-  
-
-  perf
-  
-
-  io.kamon
-  kamon-log-reporter_2.12
-
-
-  io.kamon
-  kamon-statsd_2.12
-
-
-  io.kamon
-  kamon-autoweave_2.12
-  0.6.5
-
-
-  org.aspectj
-  aspectjweaver
-
-
-  io.kamon
-  kamon-system-metrics_2.12
-  ${kamon.version}
-
-  
-
-  
-
 
diff --git a/saga-spring/pom.xml b/saga-spring/pom.xml
index fc93b56..b996e23 100755
--- a/saga-spring/pom.xml
+++ b/saga-spring/pom.xml
@@ -220,7 +220,6 @@
 
   io.kamon
   kamon-autoweave_2.12
-  0.6.5
 
 
   org.aspectj



[incubator-servicecomb-saga] branch master updated (d91c8cf -> 1a95b10)

2018-08-28 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 d91c8cf  Updated the ROADMAP.md file
 new a5c3e3e  [SCB-868] Add Kamon metrics to Alpha Server
 new 1a95b10  SCB-868 Clean up the Alpha dependencies

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


Summary of changes:
 alpha/alpha-core/pom.xml   |  6 +++-
 .../servicecomb/saga/alpha/core/EventScanner.java  | 24 ---
 alpha/alpha-server/pom.xml | 35 ++
 .../saga/alpha/server/AlphaApplication.java|  9 ++
 .../saga/alpha/server/AlphaEventController.java|  6 
 .../saga/alpha/server/GrpcTxEventEndpointImpl.java |  6 
 .../src/main/resources/META-INF/aop.xml|  0
 .../src/main/resources/application.conf|  2 +-
 alpha/pom.xml  |  1 +
 9 files changed, 83 insertions(+), 6 deletions(-)
 copy {saga-spring => alpha/alpha-server}/src/main/resources/META-INF/aop.xml 
(100%)
 copy {saga-spring => alpha/alpha-server}/src/main/resources/application.conf 
(98%)



[incubator-servicecomb-saga] branch master updated: Update the conditional-transaction-demo docker-compose file version

2018-08-28 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 0846b63  Update the conditional-transaction-demo docker-compose file 
version
0846b63 is described below

commit 0846b63376ad4a8f7c590ccfdde57cfab6558f6d
Author: Willem Jiang 
AuthorDate: Wed Aug 29 10:57:39 2018 +0800

Update the conditional-transaction-demo docker-compose file version
---
 saga-demo/conditional-transaction-demo/docker-compose.yaml | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/saga-demo/conditional-transaction-demo/docker-compose.yaml 
b/saga-demo/conditional-transaction-demo/docker-compose.yaml
index 45c72c3..b8b1bb6 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.0.3-SNAPSHOT"
+image: "payment:0.3.0-SNAPSHOT"
 hostname: payment
 ports:
   - "8080"
 
   membership:
-image: "membership:0.0.3-SNAPSHOT"
+image: "membership:0.3.0-SNAPSHOT"
 hostname: membership
 ports:
   - "8080"
 
   inventory:
-image: "inventory:0.0.3-SNAPSHOT"
+image: "inventory:0.3.0-SNAPSHOT"
 hostname: inventory
 ports:
   - "8080"
 
   supplier:
-image: "supplier:0.0.3-SNAPSHOT"
+image: "supplier:0.3.0-SNAPSHOT"
 hostname: supplier
 ports:
   - "8080"
 
   saga:
-image: "saga-spring:0.0.3-SNAPSHOT"
+image: "saga-spring:0.3.0-SNAPSHOT"
 hostname: saga
 links:
   - "postgres:postgres.servicecomb.io"



[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();
   }



[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
+  @S

[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] 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"
+im

[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
+
+  
+
+  
+
+  
 
   
 



[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++)



[incubator-servicecomb-saga] branch SCB-852 updated: SCB-852 Added the uncommitted pom of saga-core-akka

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

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


The following commit(s) were added to refs/heads/SCB-852 by this push:
 new d847a1a  SCB-852 Added the uncommitted pom of saga-core-akka
d847a1a is described below

commit d847a1a4d81a0ac11522638c16ea11686d4c4e52
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:53:39 2018 +0800

SCB-852 Added the uncommitted pom of saga-core-akka
---
 saga-core-akka/pom.xml | 120 +
 1 file changed, 120 insertions(+)

diff --git a/saga-core-akka/pom.xml b/saga-core-akka/pom.xml
new file mode 100644
index 000..a019a25
--- /dev/null
+++ b/saga-core-akka/pom.xml
@@ -0,0 +1,120 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+saga
+org.apache.servicecomb.saga
+0.3.0-SNAPSHOT
+  
+  4.0.0
+
+  saga-core-akka
+  Saga::Core::Akka
+
+  
+
+  com.lmax
+  disruptor
+
+
+  org.slf4j
+  slf4j-api
+
+
+  org.apache.logging.log4j
+  log4j-slf4j-impl
+
+
+  org.apache.logging.log4j
+  log4j-api
+
+
+  org.apache.logging.log4j
+  log4j-core
+
+
+  org.apache.servicecomb.saga
+  saga-core
+
+
+  com.typesafe.akka
+  akka-actor_2.12
+
+
+  com.typesafe.akka
+  akka-slf4j_2.12
+
+
+  io.kamon
+  kamon-core_2.12
+
+
+  io.kamon
+  kamon-annotation_2.12
+
+
+
+
+  com.typesafe.akka
+  akka-testkit_2.12
+
+
+  org.scalatest
+  scalatest_2.12
+
+
+  junit
+  junit
+
+
+  org.hamcrest
+  hamcrest-all
+
+
+  org.mockito
+  mockito-core
+  
+  1.10.19
+
+
+  org.apache.commons
+  commons-lang3
+
+
+  org.awaitility
+  awaitility
+
+
+  com.github.seanyinx
+  unit-scaffolding
+
+
+  org.apache.servicecomb.saga
+  saga-core
+  test-jar
+  0.3.0-SNAPSHOT
+  test
+
+
+  org.apache.servicecomb.saga
+  saga-core
+
+  
+
+



[incubator-servicecomb-saga] branch SCB-853 updated (249e005 -> ce83f17)

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

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


 discard 249e005  SCB-853 Saga-core noew supports JDK7
 add d847a1a  SCB-852 Added the uncommitted pom of saga-core-akka
 new ce83f17  SCB-853 Saga-core noew supports JDK7

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

 * -- * -- B -- O -- O -- O   (249e005)
\
 N -- N -- N   refs/heads/SCB-853 (ce83f17)

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

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

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


Summary of changes:
 {saga-core => saga-core-akka}/pom.xml | 65 ---
 1 file changed, 37 insertions(+), 28 deletions(-)
 copy {saga-core => saga-core-akka}/pom.xml (70%)



[incubator-servicecomb-saga] branch SCB-852 updated: SCB-852 Fixed the build error by adding saga-core-akka module

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

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


The following commit(s) were added to refs/heads/SCB-852 by this push:
 new 02950ca  SCB-852 Fixed the build error by adding saga-core-akka module
02950ca is described below

commit 02950ca271c6df74b39b3319118bd27319e3835e
Author: Willem Jiang 
AuthorDate: Mon Aug 20 08:40:02 2018 +0800

SCB-852 Fixed the build error by adding saga-core-akka module
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index 542fb1c..83e5366 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,7 @@
 
   
 saga-core
+saga-core-akka
 transports
 saga-spring
 docker-build-config



[incubator-servicecomb-saga] 01/01: SCB-853 Saga-core noew supports JDK7

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

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

commit 249e00574a2f10ec7b570a94d9432fcf9959be37
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:30:14 2018 +0800

SCB-853 Saga-core noew supports JDK7
---
 saga-core/pom.xml  | 10 
 .../servicecomb/saga/core/BackwardRecovery.java|  5 ++
 .../apache/servicecomb/saga/core/Compensation.java | 32 +--
 .../saga/core/CompositeSagaResponse.java   | 31 ---
 .../apache/servicecomb/saga/core/Descriptive.java  |  4 +-
 .../org/apache/servicecomb/saga/core/Fallback.java | 17 +-
 .../servicecomb/saga/core/ForwardRecovery.java |  5 ++
 .../servicecomb/saga/core/GraphBasedSaga.java  | 15 +++---
 .../saga/core/LoggingRecoveryPolicy.java   |  5 ++
 .../servicecomb/saga/core/NoOpSagaRequest.java |  6 +++
 .../apache/servicecomb/saga/core/Operation.java|  8 +--
 .../servicecomb/saga/core/RestOperation.java   | 14 +++--
 .../apache/servicecomb/saga/core/SagaContext.java  |  4 +-
 .../servicecomb/saga/core/SagaContextImpl.java | 35 +++-
 .../apache/servicecomb/saga/core/SagaEvent.java|  5 ++
 .../apache/servicecomb/saga/core/SagaRequest.java  |  6 +--
 .../servicecomb/saga/core/SagaTaskFactory.java | 10 ++--
 .../apache/servicecomb/saga/core/Transaction.java  | 18 +++
 .../servicecomb/saga/core/TransactionConsumer.java |  5 ++
 .../saga/core/dag/ByLevelTraveller.java|  5 +-
 .../saga/core/dag/GraphBasedSagaFactory.java   |  3 +-
 .../servicecomb/saga/core/dag/GraphBuilder.java|  9 ++--
 .../saga/core/dag/GraphCycleDetectorImpl.java  | 26 +
 .../org/apache/servicecomb/saga/core/dag/Node.java |  4 +-
 .../servicecomb/saga/core/CompensationImpl.java|  5 ++
 .../saga/core/CompositeSagaResponseTest.java   |  8 +++
 .../servicecomb/saga/core/ForwardRecoveryTest.java |  7 ++-
 .../servicecomb/saga/core/RestOperationTest.java   | 18 ---
 .../servicecomb/saga/core/RetrySagaLogTest.java| 19 +--
 .../saga/core/SagaExecutionComponentTestBase.java  | 44 +++
 .../servicecomb/saga/core/SagaIntegrationTest.java | 63 ++
 .../dag/DirectedAcyclicGraphTraversalTest.java |  4 +-
 .../saga/core/dag/GraphBuilderTest.java| 40 --
 .../saga/core/dag/GraphCycleDetectorTest.java  |  3 +-
 .../servicecomb/saga/format/JacksonFallback.java   | 11 
 35 files changed, 366 insertions(+), 138 deletions(-)

diff --git a/saga-core/pom.xml b/saga-core/pom.xml
index fd1b47c..e460b1a 100644
--- a/saga-core/pom.xml
+++ b/saga-core/pom.xml
@@ -95,6 +95,16 @@
   
 
   
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+3.1
+
+  UTF-8
+  1.7
+  1.7
+
+  
 
   
 
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
index e46de2f..799dbbf 100644
--- 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
@@ -46,4 +46,9 @@ public class BackwardRecovery implements RecoveryPolicy {
   throw e;
 }
   }
+
+  @Override
+  public String description() {
+return getClass().getSimpleName();
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
index f642011..a6a352b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
@@ -20,14 +20,40 @@ package org.apache.servicecomb.saga.core;
 public interface Compensation extends Operation {
 
   Compensation SAGA_START_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   Compensation SAGA_END_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   int DEFAULT_RETRIES = 3;
 
-  default int retries() {
-return DEFAULT_RETRIES;
-  }
+  int retries();
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core

[incubator-servicecomb-saga] branch SCB-853 created (now 249e005)

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

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


  at 249e005  SCB-853 Saga-core noew supports JDK7

This branch includes the following new commits:

 new 249e005  SCB-853 Saga-core noew supports JDK7

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




[incubator-servicecomb-saga] 01/01: SCB-853 Saga-core noew supports JDK7

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

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

commit ce83f17b89dcdf013961f713d62dcd452aa4420e
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:30:14 2018 +0800

SCB-853 Saga-core noew supports JDK7
---
 saga-core/pom.xml  | 10 
 .../servicecomb/saga/core/BackwardRecovery.java|  5 ++
 .../apache/servicecomb/saga/core/Compensation.java | 32 +--
 .../saga/core/CompositeSagaResponse.java   | 31 ---
 .../apache/servicecomb/saga/core/Descriptive.java  |  4 +-
 .../org/apache/servicecomb/saga/core/Fallback.java | 17 +-
 .../servicecomb/saga/core/ForwardRecovery.java |  5 ++
 .../servicecomb/saga/core/GraphBasedSaga.java  | 15 +++---
 .../saga/core/LoggingRecoveryPolicy.java   |  5 ++
 .../servicecomb/saga/core/NoOpSagaRequest.java |  6 +++
 .../apache/servicecomb/saga/core/Operation.java|  8 +--
 .../servicecomb/saga/core/RestOperation.java   | 14 +++--
 .../apache/servicecomb/saga/core/SagaContext.java  |  4 +-
 .../servicecomb/saga/core/SagaContextImpl.java | 35 +++-
 .../apache/servicecomb/saga/core/SagaEvent.java|  5 ++
 .../apache/servicecomb/saga/core/SagaRequest.java  |  6 +--
 .../servicecomb/saga/core/SagaTaskFactory.java | 10 ++--
 .../apache/servicecomb/saga/core/Transaction.java  | 18 +++
 .../servicecomb/saga/core/TransactionConsumer.java |  5 ++
 .../saga/core/dag/ByLevelTraveller.java|  5 +-
 .../saga/core/dag/GraphBasedSagaFactory.java   |  3 +-
 .../servicecomb/saga/core/dag/GraphBuilder.java|  9 ++--
 .../saga/core/dag/GraphCycleDetectorImpl.java  | 26 +
 .../org/apache/servicecomb/saga/core/dag/Node.java |  4 +-
 .../servicecomb/saga/core/CompensationImpl.java|  5 ++
 .../saga/core/CompositeSagaResponseTest.java   |  8 +++
 .../servicecomb/saga/core/ForwardRecoveryTest.java |  7 ++-
 .../servicecomb/saga/core/RestOperationTest.java   | 18 ---
 .../servicecomb/saga/core/RetrySagaLogTest.java| 19 +--
 .../saga/core/SagaExecutionComponentTestBase.java  | 44 +++
 .../servicecomb/saga/core/SagaIntegrationTest.java | 63 ++
 .../dag/DirectedAcyclicGraphTraversalTest.java |  4 +-
 .../saga/core/dag/GraphBuilderTest.java| 40 --
 .../saga/core/dag/GraphCycleDetectorTest.java  |  3 +-
 .../servicecomb/saga/format/JacksonFallback.java   | 11 
 35 files changed, 366 insertions(+), 138 deletions(-)

diff --git a/saga-core/pom.xml b/saga-core/pom.xml
index fd1b47c..e460b1a 100644
--- a/saga-core/pom.xml
+++ b/saga-core/pom.xml
@@ -95,6 +95,16 @@
   
 
   
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+3.1
+
+  UTF-8
+  1.7
+  1.7
+
+  
 
   
 
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
index e46de2f..799dbbf 100644
--- 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
@@ -46,4 +46,9 @@ public class BackwardRecovery implements RecoveryPolicy {
   throw e;
 }
   }
+
+  @Override
+  public String description() {
+return getClass().getSimpleName();
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
index f642011..a6a352b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
@@ -20,14 +20,40 @@ package org.apache.servicecomb.saga.core;
 public interface Compensation extends Operation {
 
   Compensation SAGA_START_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   Compensation SAGA_END_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   int DEFAULT_RETRIES = 3;
 
-  default int retries() {
-return DEFAULT_RETRIES;
-  }
+  int retries();
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core

[incubator-servicecomb-website] branch master updated: edit homepage latest news & add github link

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

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


The following commit(s) were added to refs/heads/master by this push:
 new db91880  edit homepage latest news & add github link
db91880 is described below

commit db91880dca51864d216b0ca510ba0419398d6b74
Author: Wang Kirin 
AuthorDate: Tue Aug 14 15:15:44 2018 +0800

edit homepage latest news & add github link

Signed-off-by: Wang Kirin 
---
 _pages/cn/home.md | 14 --
 _posts/cn/2018-8-13-1.0.0-release-note.md | 15 ++-
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/_pages/cn/home.md b/_pages/cn/home.md
old mode 100644
new mode 100755
index 1b47010..37f7935
--- a/_pages/cn/home.md
+++ b/_pages/cn/home.md
@@ -22,13 +22,10 @@ intro:
 
 
   
-微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料
-  
-  
-ServiceComb 第一个Apache孵化版本发布了!
+[里程碑]Apache ServiceComb 
1.0.0版本正式发布
   
   
-号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
+微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料
   
   
 Join us at Gitter
@@ -37,13 +34,10 @@ intro:
 
 
   
-Java-Chassis 发布最新版 1.0.0
-  
-  
-Service-Center 发布最新版 1.0.0
+Saga releases 发布最新版 0.2.0
   
   
-Saga releases 发布最新版 0.2.0
+号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
   
   
 这个视频演示了如何Service-Center前端直接从浏览器测试已注册的微服务
diff --git a/_posts/cn/2018-8-13-1.0.0-release-note.md 
b/_posts/cn/2018-8-13-1.0.0-release-note.md
index 23b80c4..7cc4e56 100755
--- a/_posts/cn/2018-8-13-1.0.0-release-note.md
+++ b/_posts/cn/2018-8-13-1.0.0-release-note.md
@@ -134,4 +134,17 @@ redirect_from:
 - 服务依赖管理采用事件驱动机制 
 - 提升ETCD链接的弹性伸缩能力和自我修复能力
 - Service-Center 支持在多基础设施中部署
-- 优化前端界面UI,提供更多功能及提升易用性
\ No newline at end of file
+- 优化前端界面UI,提供更多功能及提升易用性
+
+
+## 下载地址:
+
+Java-chassis:
+
+[http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0/](http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0/)
+
+Service-Center:
+
+[http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0/](http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0/)
+
+



[incubator-servicecomb-saga] branch master updated: SCB-853 Saga-core supports JDK7 now

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 7e586b5  SCB-853 Saga-core supports JDK7 now
7e586b5 is described below

commit 7e586b569c61b6faafe1d376922a49522fcba848
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:30:14 2018 +0800

SCB-853 Saga-core supports JDK7 now
---
 saga-core/pom.xml  | 10 
 .../servicecomb/saga/core/BackwardRecovery.java|  5 ++
 .../apache/servicecomb/saga/core/Compensation.java | 32 +--
 .../saga/core/CompositeSagaResponse.java   | 31 ---
 .../apache/servicecomb/saga/core/Descriptive.java  |  4 +-
 .../org/apache/servicecomb/saga/core/Fallback.java | 17 +-
 .../servicecomb/saga/core/ForwardRecovery.java |  5 ++
 .../servicecomb/saga/core/GraphBasedSaga.java  | 15 +++---
 .../saga/core/LoggingRecoveryPolicy.java   |  5 ++
 .../servicecomb/saga/core/NoOpSagaRequest.java |  6 +++
 .../apache/servicecomb/saga/core/Operation.java|  8 +--
 .../servicecomb/saga/core/RestOperation.java   | 14 +++--
 .../apache/servicecomb/saga/core/SagaContext.java  |  4 +-
 .../servicecomb/saga/core/SagaContextImpl.java | 35 +++-
 .../apache/servicecomb/saga/core/SagaEvent.java|  5 ++
 .../apache/servicecomb/saga/core/SagaRequest.java  |  6 +--
 .../servicecomb/saga/core/SagaTaskFactory.java | 10 ++--
 .../apache/servicecomb/saga/core/Transaction.java  | 18 +++
 .../servicecomb/saga/core/TransactionConsumer.java |  5 ++
 .../saga/core/dag/ByLevelTraveller.java|  5 +-
 .../saga/core/dag/GraphBasedSagaFactory.java   |  3 +-
 .../servicecomb/saga/core/dag/GraphBuilder.java|  9 ++--
 .../saga/core/dag/GraphCycleDetectorImpl.java  | 26 +
 .../org/apache/servicecomb/saga/core/dag/Node.java |  4 +-
 .../servicecomb/saga/core/CompensationImpl.java|  5 ++
 .../saga/core/CompositeSagaResponseTest.java   |  8 +++
 .../servicecomb/saga/core/ForwardRecoveryTest.java |  7 ++-
 .../servicecomb/saga/core/RestOperationTest.java   | 18 ---
 .../servicecomb/saga/core/RetrySagaLogTest.java| 19 +--
 .../saga/core/SagaExecutionComponentTestBase.java  | 44 +++
 .../servicecomb/saga/core/SagaIntegrationTest.java | 63 ++
 .../dag/DirectedAcyclicGraphTraversalTest.java |  4 +-
 .../saga/core/dag/GraphBuilderTest.java| 40 --
 .../saga/core/dag/GraphCycleDetectorTest.java  |  3 +-
 .../servicecomb/saga/format/JacksonFallback.java   | 11 
 35 files changed, 366 insertions(+), 138 deletions(-)

diff --git a/saga-core/pom.xml b/saga-core/pom.xml
index fd1b47c..e460b1a 100644
--- a/saga-core/pom.xml
+++ b/saga-core/pom.xml
@@ -95,6 +95,16 @@
   
 
   
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+3.1
+
+  UTF-8
+  1.7
+  1.7
+
+  
 
   
 
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
index e46de2f..799dbbf 100644
--- 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
@@ -46,4 +46,9 @@ public class BackwardRecovery implements RecoveryPolicy {
   throw e;
 }
   }
+
+  @Override
+  public String description() {
+return getClass().getSimpleName();
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
index f642011..a6a352b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
@@ -20,14 +20,40 @@ package org.apache.servicecomb.saga.core;
 public interface Compensation extends Operation {
 
   Compensation SAGA_START_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   Compensation SAGA_END_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   int DEFAULT_RETRIES = 3;
 
-  default

[incubator-servicecomb-website] branch asf-site updated: Publish the website

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

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


The following commit(s) were added to refs/heads/asf-site by this push:
 new 44bb2b9  Publish the website
44bb2b9 is described below

commit 44bb2b919f66524b73ded0200bae4b7b489458ed
Author: Willem Jiang 
AuthorDate: Mon Aug 20 11:04:09 2018 +0800

Publish the website
---
 content/cn/docs/release_note_1_0_0.html | 11 +++
 content/cn/index.html   |  4 ++--
 content/feed.xml| 14 --
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/content/cn/docs/release_note_1_0_0.html 
b/content/cn/docs/release_note_1_0_0.html
index 58804f0..4ca3b60 100644
--- a/content/cn/docs/release_note_1_0_0.html
+++ b/content/cn/docs/release_note_1_0_0.html
@@ -560,6 +560,17 @@
   优化前端界面UI,提供更多功能及提升易用性
 
 
+下载地址:
+
+Java-chassis:
+
+http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0/;>http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0/
+
+Service-Center:
+
+http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0/;>http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0/
+
+
 
   
 
diff --git a/content/cn/index.html b/content/cn/index.html
index 539fb41..7465427 100644
--- a/content/cn/index.html
+++ b/content/cn/index.html
@@ -293,8 +293,8 @@
   
 
   最新新闻
-  微服务 Meetup:Apache 
ServiceComb (incubating) Day 演讲资料   ServiceComb 第一个Apache孵化版本发布了!   号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
   https://gitter.im/ServiceCombUsers/Lobby;>Join us at 
Gitter  
-  Java-Chassis 发布最新版 
1.0.0   Service-Center 发布最新版 1.0.0  
 Saga releases 发布最新版 0.2.0  
 https://www.youtube.com/watch?v=yrAneJvVC7A;>这个视频演示了如何Service-Center前端直接从浏览器测试已注册的微服务
  
+  [里程碑]Apache ServiceComb 
1.0.0版本正式发布   微服务 Meetup:Apache ServiceComb 
(incubating) Day 演讲资料   https://gitter.im/ServiceCombUsers/Lobby;>Join us at Gitter  

+  Saga releases 发布最新版 0.2.0 
  号外:现在ServiceComb提供了微服务场景下的数据一致性解决方案Saga!
   https://www.youtube.com/watch?v=yrAneJvVC7A;>这个视频演示了如何Service-Center前端直接从浏览器测试已注册的微服务
  
 
 
   
diff --git a/content/feed.xml b/content/feed.xml
index f55805d..930f566 100644
--- a/content/feed.xml
+++ b/content/feed.xml
@@ -1,4 +1,4 @@
-http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-08-13T22:41:25+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
+http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-08-20T11:03:18+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
 
 h2 id=java-chassisJava-chassis/h2
 
@@ -183,7 +183,17 @@
   li提升ETCD链接的弹性伸缩能力和自我修复能力/li
   liService-Center 支持在多基础设施中部署/li
   li优化前端界面UI,提供更多功能及提升易用性/li
-/ulWang 
Qilinwangqilint...@gmail.comhttps://github.com/wangkirinServieComb版本正式步入稳定态Consul Service Mesh实战2018-07-21T00:00:00+08:00http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0/http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-java-chassis/1.0.0//a/p;
+
+pService-Center:/p
+
+pa 
href=http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0/http://apache.org/dyn/closer.cgi/incubator/servicecomb/incubator-servicecomb-service-center/1.0.0//a/p;Wang
 
Qilinwangqilint...@gmail.comhttps://github.com/wangkirinServieComb版本正式步入稳 [...]
 
 p在最近发布的a 
href=https://github.com/hashicorp/consul/releasesConsul1.2/a中,a
 href=https://www.hashicorp.com/HashiCorp/a宣布支持Service 
Mesh。作为一个优秀的分布式服务发现解决方案,Consul是如何支持Service Mesh的呢?本文将带读者一探究竟。/p
 



[incubator-servicecomb-website] branch asf-site updated (6c6887a -> 2fa73cc)

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

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


from 6c6887a  Publish the website
 add db91880  edit homepage latest news & add github link
 new 2fa73cc  Merge branch 'master' into asf-site

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


Summary of changes:
 _pages/cn/home.md | 14 --
 _posts/cn/2018-8-13-1.0.0-release-note.md | 15 ++-
 2 files changed, 18 insertions(+), 11 deletions(-)
 mode change 100644 => 100755 _pages/cn/home.md



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

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

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

commit 2fa73cc906b0c5e5cf1ce79138b1ef90929358dc
Merge: 6c6887a db91880
Author: Willem Jiang 
AuthorDate: Mon Aug 20 11:02:59 2018 +0800

Merge branch 'master' into asf-site

 _pages/cn/home.md | 14 --
 _posts/cn/2018-8-13-1.0.0-release-note.md | 15 ++-
 2 files changed, 18 insertions(+), 11 deletions(-)



[incubator-servicecomb-saga] 01/01: SCB-853 Saga-core supports JDK7 now

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

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

commit 664591e7baf47c765355c23e6a34fac061fbb270
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:30:14 2018 +0800

SCB-853 Saga-core supports JDK7 now
---
 saga-core/pom.xml  | 10 
 .../servicecomb/saga/core/BackwardRecovery.java|  5 ++
 .../apache/servicecomb/saga/core/Compensation.java | 32 +--
 .../saga/core/CompositeSagaResponse.java   | 31 ---
 .../apache/servicecomb/saga/core/Descriptive.java  |  4 +-
 .../org/apache/servicecomb/saga/core/Fallback.java | 17 +-
 .../servicecomb/saga/core/ForwardRecovery.java |  5 ++
 .../servicecomb/saga/core/GraphBasedSaga.java  | 15 +++---
 .../saga/core/LoggingRecoveryPolicy.java   |  5 ++
 .../servicecomb/saga/core/NoOpSagaRequest.java |  6 +++
 .../apache/servicecomb/saga/core/Operation.java|  8 +--
 .../servicecomb/saga/core/RestOperation.java   | 14 +++--
 .../apache/servicecomb/saga/core/SagaContext.java  |  4 +-
 .../servicecomb/saga/core/SagaContextImpl.java | 35 +++-
 .../apache/servicecomb/saga/core/SagaEvent.java|  5 ++
 .../apache/servicecomb/saga/core/SagaRequest.java  |  6 +--
 .../servicecomb/saga/core/SagaTaskFactory.java | 10 ++--
 .../apache/servicecomb/saga/core/Transaction.java  | 18 +++
 .../servicecomb/saga/core/TransactionConsumer.java |  5 ++
 .../saga/core/dag/ByLevelTraveller.java|  5 +-
 .../saga/core/dag/GraphBasedSagaFactory.java   |  3 +-
 .../servicecomb/saga/core/dag/GraphBuilder.java|  9 ++--
 .../saga/core/dag/GraphCycleDetectorImpl.java  | 26 +
 .../org/apache/servicecomb/saga/core/dag/Node.java |  4 +-
 .../servicecomb/saga/core/CompensationImpl.java|  5 ++
 .../saga/core/CompositeSagaResponseTest.java   |  8 +++
 .../servicecomb/saga/core/ForwardRecoveryTest.java |  7 ++-
 .../servicecomb/saga/core/RestOperationTest.java   | 18 ---
 .../servicecomb/saga/core/RetrySagaLogTest.java| 19 +--
 .../saga/core/SagaExecutionComponentTestBase.java  | 44 +++
 .../servicecomb/saga/core/SagaIntegrationTest.java | 63 ++
 .../dag/DirectedAcyclicGraphTraversalTest.java |  4 +-
 .../saga/core/dag/GraphBuilderTest.java| 40 --
 .../saga/core/dag/GraphCycleDetectorTest.java  |  3 +-
 .../servicecomb/saga/format/JacksonFallback.java   | 11 
 35 files changed, 366 insertions(+), 138 deletions(-)

diff --git a/saga-core/pom.xml b/saga-core/pom.xml
index fd1b47c..e460b1a 100644
--- a/saga-core/pom.xml
+++ b/saga-core/pom.xml
@@ -95,6 +95,16 @@
   
 
   
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+3.1
+
+  UTF-8
+  1.7
+  1.7
+
+  
 
   
 
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
index e46de2f..799dbbf 100644
--- 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
+++ 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/BackwardRecovery.java
@@ -46,4 +46,9 @@ public class BackwardRecovery implements RecoveryPolicy {
   throw e;
 }
   }
+
+  @Override
+  public String description() {
+return getClass().getSimpleName();
+  }
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java 
b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
index f642011..a6a352b 100644
--- a/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
+++ b/saga-core/src/main/java/org/apache/servicecomb/saga/core/Compensation.java
@@ -20,14 +20,40 @@ package org.apache.servicecomb.saga.core;
 public interface Compensation extends Operation {
 
   Compensation SAGA_START_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   Compensation SAGA_END_COMPENSATION = new Compensation() {
+@Override
+public SagaResponse send(String address) {
+  return SUCCESSFUL_SAGA_RESPONSE;
+}
+
+@Override
+public SagaResponse send(String address, SagaResponse response) {
+  return send(address);
+}
+
+@Override
+public int retries() {
+  return DEFAULT_RETRIES;
+}
   };
 
   int DEFAULT_RETRIES = 3;
 
-  default int retries() {
-return DEFAULT_RETRIES;
-  }
+  int retries();
 }
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core

[incubator-servicecomb-saga] branch SCB-853 updated (664591e -> c89350f)

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

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


from 664591e  SCB-853 Saga-core supports JDK7 now
 add 8a2bcbe  SCB-852 Split akka related code to saga-core-akka
 add c1f0a10  SCB-852 Fixed the build error by adding saga-core-akka module
 add 089ffd7  SCB-852 Added the uncommitted pom of saga-core-akka
 new c89350f  Merge branch 'master' into SCB-853

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


Summary of changes:



[incubator-servicecomb-saga] branch SCB-853 updated (bd60f3f -> 664591e)

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

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


omit bd60f3f  Merge branch 'master' into SCB-853
omit 089ffd7  SCB-852 Added the uncommitted pom of saga-core-akka
omit c1f0a10  SCB-852 Fixed the build error by adding saga-core-akka module
omit 8a2bcbe  SCB-852 Split akka related code to saga-core-akka
omit ce83f17  SCB-853 Saga-core noew supports JDK7
 new 664591e  SCB-853 Saga-core supports JDK7 now

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

 * -- * -- B -- O -- O -- O   (bd60f3f)
\
 N -- N -- N   refs/heads/SCB-853 (664591e)

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

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

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


Summary of changes:



[incubator-servicecomb-saga] 01/01: Merge branch 'master' into SCB-853

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

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

commit c89350f33493b9c648985bce7b9fb0c45630579e
Merge: 664591e 089ffd7
Author: Willem Jiang 
AuthorDate: Mon Aug 20 12:30:09 2018 +0800

Merge branch 'master' into SCB-853




[incubator-servicecomb-saga] branch SCB-852 deleted (was d847a1a)

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

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


 was d847a1a  SCB-852 Added the uncommitted pom of saga-core-akka

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



[incubator-servicecomb-saga] 01/03: SCB-852 Split akka related code to saga-core-akka

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

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

commit 8a2bcbec1f9f58a2ec2f43498bff506effcce93b
Author: Willem Jiang 
AuthorDate: Sun Aug 19 20:39:26 2018 +0800

SCB-852 Split akka related code to saga-core-akka
---
 pom.xml| 11 +++
 .../saga/core/actors/ActorBasedSaga.java   |  2 +-
 .../saga/core/actors/ActorBasedSagaFactory.java|  0
 .../saga/core/actors/CompletionCallbackActor.java  |  0
 .../saga/core/actors/EventContextImpl.java |  0
 .../servicecomb/saga/core/actors/RequestActor.java |  0
 .../saga/core/actors/RequestActorBuilder.java  |  0
 .../saga/core/actors/RequestActorContext.java  |  0
 .../saga/core/actors/messages/AbortMessage.java|  0
 .../core/actors/messages/AbortRecoveryMessage.java |  0
 .../core/actors/messages/CompensateMessage.java|  0
 .../messages/CompensationRecoveryMessage.java  |  0
 .../saga/core/actors/messages/FailMessage.java |  0
 .../saga/core/actors/messages/Message.java |  0
 .../saga/core/actors/messages/TransactMessage.java |  1 +
 .../messages/TransactionRecoveryMessage.java   |  0
 .../ActorBasedSagaExecutionComponentTest.java  |  2 +-
 .../core/actors/ActorBasedSagaIntegrationTest.java | 16 +-
 .../core/actors/CompletionCallbackActorTest.java   |  4 +--
 .../saga/core/actors/EventContextImplTest.java |  0
 .../saga/core/actors/RequestActorBuilderTest.java  |  2 +-
 .../saga/core/actors/RequestActorTest.java |  0
 saga-core-akka/src/test/resources/application.conf | 21 +
 saga-core-akka/src/test/resources/log4j2.xml   | 30 ++
 saga-core/pom.xml  | 36 ++
 saga-spring/pom.xml|  4 +++
 26 files changed, 96 insertions(+), 33 deletions(-)

diff --git a/pom.xml b/pom.xml
index e8cfe75..542fb1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -252,6 +252,17 @@
   
   
 org.apache.servicecomb.saga
+saga-core-akka
+0.3.0-SNAPSHOT
+  
+  
+org.apache.servicecomb.saga
+saga-core
+test-jar
+0.3.0-SNAPSHOT
+  
+  
+org.apache.servicecomb.saga
 saga-format
 0.3.0-SNAPSHOT
   
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
 
b/saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
similarity index 100%
rename from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
rename to 
saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
index bf60f98..36fae1f 100644
--- 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
+++ 
b/saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
@@ -23,9 +23,9 @@ import org.apache.servicecomb.saga.core.EventContext;
 import org.apache.servicecomb.saga.core.EventStore;
 import org.apache.servicecomb.saga.core.NoOpSagaRequest;
 import org.apache.servicecomb.saga.core.Saga;
+import org.apache.servicecomb.saga.core.SagaEvent;
 import org.apache.servicecomb.saga.core.SagaResponse;
 import org.apache.servicecomb.saga.core.actors.messages.TransactMessage;
-import org.apache.servicecomb.saga.core.SagaEvent;
 
 import akka.actor.ActorRef;
 
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaFactory.java
 
b/saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaFactory.java
similarity index 100%
rename from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaFactory.java
rename to 
saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaFactory.java
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActor.java
 
b/saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActor.java
similarity index 100%
rename from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActor.java
rename to 
saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActor.java
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/EventContextImpl.java
 
b/saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/EventContextImpl.java
similarity index 100%
rename from 
saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/EventContextImpl.java
rename to 
saga-core-akka/src/main/java/org/apache/servicecomb/saga/core/actors/EventContextImpl.java
diff --git 
a/saga-core/src/main/java/org/apache/servicecomb/saga/core/actors/RequestActor.java
 
b/saga-core-akka/src/main/java/org/apache

[incubator-servicecomb-saga] 02/03: SCB-852 Fixed the build error by adding saga-core-akka module

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

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

commit c1f0a10d326e0c0aabc5a5591f5b519ee8c758c3
Author: Willem Jiang 
AuthorDate: Mon Aug 20 08:40:02 2018 +0800

SCB-852 Fixed the build error by adding saga-core-akka module
---
 pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pom.xml b/pom.xml
index 542fb1c..83e5366 100644
--- a/pom.xml
+++ b/pom.xml
@@ -32,6 +32,7 @@
 
   
 saga-core
+saga-core-akka
 transports
 saga-spring
 docker-build-config



[incubator-servicecomb-saga] 03/03: SCB-852 Added the uncommitted pom of saga-core-akka

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

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

commit 089ffd7de55cb840540465bf53171d71254d1b89
Author: Willem Jiang 
AuthorDate: Mon Aug 20 09:53:39 2018 +0800

SCB-852 Added the uncommitted pom of saga-core-akka
---
 saga-core-akka/pom.xml | 120 +
 1 file changed, 120 insertions(+)

diff --git a/saga-core-akka/pom.xml b/saga-core-akka/pom.xml
new file mode 100644
index 000..a019a25
--- /dev/null
+++ b/saga-core-akka/pom.xml
@@ -0,0 +1,120 @@
+
+
+
+http://maven.apache.org/POM/4.0.0; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;>
+  
+saga
+org.apache.servicecomb.saga
+0.3.0-SNAPSHOT
+  
+  4.0.0
+
+  saga-core-akka
+  Saga::Core::Akka
+
+  
+
+  com.lmax
+  disruptor
+
+
+  org.slf4j
+  slf4j-api
+
+
+  org.apache.logging.log4j
+  log4j-slf4j-impl
+
+
+  org.apache.logging.log4j
+  log4j-api
+
+
+  org.apache.logging.log4j
+  log4j-core
+
+
+  org.apache.servicecomb.saga
+  saga-core
+
+
+  com.typesafe.akka
+  akka-actor_2.12
+
+
+  com.typesafe.akka
+  akka-slf4j_2.12
+
+
+  io.kamon
+  kamon-core_2.12
+
+
+  io.kamon
+  kamon-annotation_2.12
+
+
+
+
+  com.typesafe.akka
+  akka-testkit_2.12
+
+
+  org.scalatest
+  scalatest_2.12
+
+
+  junit
+  junit
+
+
+  org.hamcrest
+  hamcrest-all
+
+
+  org.mockito
+  mockito-core
+  
+  1.10.19
+
+
+  org.apache.commons
+  commons-lang3
+
+
+  org.awaitility
+  awaitility
+
+
+  com.github.seanyinx
+  unit-scaffolding
+
+
+  org.apache.servicecomb.saga
+  saga-core
+  test-jar
+  0.3.0-SNAPSHOT
+  test
+
+
+  org.apache.servicecomb.saga
+  saga-core
+
+  
+
+



[incubator-servicecomb-saga] branch master updated (66344e7 -> 089ffd7)

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

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


from 66344e7  Fixed the deprecated warning issues of saga-core
 new 8a2bcbe  SCB-852 Split akka related code to saga-core-akka
 new c1f0a10  SCB-852 Fixed the build error by adding saga-core-akka module
 new 089ffd7  SCB-852 Added the uncommitted pom of saga-core-akka

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


Summary of changes:
 pom.xml| 12 
 {saga-core => saga-core-akka}/pom.xml  | 19 ++--
 .../saga/core/actors/ActorBasedSaga.java   |  2 +-
 .../saga/core/actors/ActorBasedSagaFactory.java|  0
 .../saga/core/actors/CompletionCallbackActor.java  |  0
 .../saga/core/actors/EventContextImpl.java |  0
 .../servicecomb/saga/core/actors/RequestActor.java |  0
 .../saga/core/actors/RequestActorBuilder.java  |  0
 .../saga/core/actors/RequestActorContext.java  |  0
 .../saga/core/actors/messages/AbortMessage.java|  0
 .../core/actors/messages/AbortRecoveryMessage.java |  0
 .../core/actors/messages/CompensateMessage.java|  0
 .../messages/CompensationRecoveryMessage.java  |  0
 .../saga/core/actors/messages/FailMessage.java |  0
 .../saga/core/actors/messages/Message.java |  0
 .../saga/core/actors/messages/TransactMessage.java |  1 +
 .../messages/TransactionRecoveryMessage.java   |  0
 .../ActorBasedSagaExecutionComponentTest.java  |  2 +-
 .../core/actors/ActorBasedSagaIntegrationTest.java | 16 +-
 .../core/actors/CompletionCallbackActorTest.java   |  4 +--
 .../saga/core/actors/EventContextImplTest.java |  0
 .../saga/core/actors/RequestActorBuilderTest.java  |  2 +-
 .../saga/core/actors/RequestActorTest.java |  0
 .../src/test/resources/application.conf|  0
 .../src/test}/resources/log4j2.xml |  0
 saga-core/pom.xml  | 36 ++
 saga-spring/pom.xml|  4 +++
 27 files changed, 63 insertions(+), 35 deletions(-)
 copy {saga-core => saga-core-akka}/pom.xml (86%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSaga.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaFactory.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActor.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/EventContextImpl.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/RequestActor.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/RequestActorBuilder.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/RequestActorContext.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/AbortMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/AbortRecoveryMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/CompensateMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/CompensationRecoveryMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/FailMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/Message.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/TransactMessage.java
 (99%)
 rename {saga-core => 
saga-core-akka}/src/main/java/org/apache/servicecomb/saga/core/actors/messages/TransactionRecoveryMessage.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/test/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaExecutionComponentTest.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/test/java/org/apache/servicecomb/saga/core/actors/ActorBasedSagaIntegrationTest.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/test/java/org/apache/servicecomb/saga/core/actors/CompletionCallbackActorTest.java
 (100%)
 rename {saga-core => 
saga-core-akka}/src/test/java/org/apache/servicecomb/saga/core/actors/EventContextIm

[incubator-servicecomb-saga] 01/01: Merge branch 'master' into SCB-853

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

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

commit bd60f3fa9ce209df7306d06b8e6bc8d029ce8a0d
Merge: ce83f17 089ffd7
Author: Willem Jiang 
AuthorDate: Mon Aug 20 12:26:45 2018 +0800

Merge branch 'master' into SCB-853




[incubator-servicecomb-saga] 05/05: SCB-817 Updated the grpc file of TccEventService

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

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

commit 4efa3a96c3bb0923c9d6db008d4a9e5cdb83da4f
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:10:07 2018 +0800

SCB-817 Updated the grpc file of TccEventService
---
 .../src/main/proto/GrpcTccEvent.proto  | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index 1eba5e5..9e1752f 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -24,23 +24,23 @@ option java_outer_classname = "TccEventProto";
 import "GrpcCommon.proto";
 
 service TccEventService {
-  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcTccCordinateCommand) 
{
   }
-  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
-  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
+  rpc participate(GrpcTccParticipateEvent) returns (GrpcAck) {}
+  rpc OnTccTransactionStarted (GrpcTccTransactionStartedEvent) returns 
(GrpcAck) {}
+  rpc OnTccTransactionEnded (GrpcTccTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcTransactionStartedEvent {
+message GrpcTccTransactionStartedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
 }
 
-message GrpcParticipateEvent {
+message GrpcTccParticipateEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -49,7 +49,7 @@ message GrpcParticipateEvent {
   string cancelMethod = 7;
 }
 
-message GrpcTransactionEndedEvent {
+message GrpcTccTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
@@ -57,10 +57,10 @@ message GrpcTransactionEndedEvent {
   string type = 5;
 }
 
-message GrpcCordinateCommand {
+message GrpcTccCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string type = 4;
+  string method = 4;
 }
 



[incubator-servicecomb-saga] 02/05: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 0c1663454afb885308c0b035a918589204c64256
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:44:06 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   |  7 +++
 .../annotations/{TCC.java => Participate.java} | 14 ++---
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 ---
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 --
 .../transaction/tcc/TccParticipatorAspect.java | 68 ++
 .../tcc/TccStartAnnotationProcessor.java   |  6 +-
 .../saga/omega/transaction/tcc/TccStartAspect.java |  7 ++-
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 ---
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 ---
 .../omega/transaction/tcc/events/TccEndEvent.java  | 14 +
 .../transaction/tcc/events/TccStartEvent.java  | 25 
 .../tcc/events/TransactionEndEvent.java|  4 --
 .../tcc/events/TransationStartEvent.java   |  4 --
 13 files changed, 129 insertions(+), 112 deletions(-)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
index c9154f9..6c8afd2 100644
--- 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -12,4 +12,11 @@ import java.lang.annotation.Target;
 @Retention(RUNTIME)
 @Target(METHOD)
 public @interface TccStart {
+  /**
+   * TCC timeout, in seconds. 
+   * Default value is 0, which means never timeout.
+   *
+   * @return
+   */
+  int timeout() default 0;
 }
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
similarity index 79%
rename from 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
rename to 
omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
index a095978..8351076 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/Participate.java
@@ -25,22 +25,22 @@ import java.lang.annotation.Target;
 @Target({ElementType.METHOD})
 /**
  * Indicates the annotated method will start a sub-transaction. 
- * A @TCC method should satisfy below requirements:
+ * A @Participate method should satisfy below requirements:
  * 
  *   all parameters are serialized
  *   is idempotent
- *   the object instance which @TCC method resides in should be 
stateless
+ *   the object instance which @Participate method resides in should be 
stateless
  * 
  */
-public @interface TCC {
+public @interface Participate {
   /**
* Confirm method name.
* A confirm method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
@@ -51,10 +51,10 @@ public @interface TCC {
* Cancel method name.
* A cancel method should satisfy below requirements:
* 
-   *   has same parameter list as @TCC method's
+   *   has same parameter list as @Participate method's
*   all parameters are serialized
*   is idempotent
-   *   be in the same class as @TCC method is in
+   *   be in the same class as @Participate method is in
* 
*
* @return
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
deleted file mode 100644
index 173cb78..000
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.servicecomb.saga.omega.transaction.tcc;
-
-import java.lang.invoke.MethodHandles;
-import java.lang.reflect.Method;
-
-import org.apache.servicecomb.saga.omega.context.OmegaContext;
-import org.apache.servicecomb.saga.omega.transaction.CompensableInterceptor;
-import org.apache.servicecomb.saga.omega.transaction.MessageSender;
-import org.apache.servicecomb.saga.omega.transaction.RecoveryPolicy;
-imp

[incubator-servicecomb-saga] 03/05: SCB-817 Updated the pack-contracts protocal for TCC

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

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

commit 277ff27ef353f650a1f543b8fd77f64ac0c035eb
Author: Willem Jiang 
AuthorDate: Thu Aug 16 10:52:19 2018 +0800

SCB-817 Updated the pack-contracts protocal for TCC
---
 .../proto/{GrpcTxEvent.proto => GrpcCommon.proto}  | 33 +
 .../{GrpcTxEvent.proto => GrpcTccEvent.proto}  | 43 --
 .../src/main/proto/GrpcTxEvent.proto   | 11 +-
 3 files changed, 26 insertions(+), 61 deletions(-)

diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
similarity index 58%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
index d2c6f77..40a8db7 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcCommon.proto
@@ -19,15 +19,8 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
-  }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
-  rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
-  }
-}
+// Define the common structs which could be use for TccEventService and 
SagaEventService
 
 message GrpcServiceConfig {
   string serviceName = 1;
@@ -37,27 +30,3 @@ message GrpcServiceConfig {
 message GrpcAck {
   bool aborted = 1;
 }
-
-message GrpcTxEvent {
-  int64 timestamp = 1;
-  string globalTxId = 2;
-  string localTxId = 3;
-  string parentTxId = 4;
-  string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
-}
-
-message GrpcCompensateCommand {
-  string globalTxId = 1;
-  string localTxId = 2;
-  string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
-}
-
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
similarity index 60%
copy from pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
copy to pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
index d2c6f77..1eba5e5 100644
--- a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
+++ b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTccEvent.proto
@@ -19,45 +19,48 @@ syntax = "proto3";
 
 option java_multiple_files = true;
 option java_package = "org.apache.servicecomb.saga.pack.contract.grpc";
-option java_outer_classname = "TxEventProto";
+option java_outer_classname = "TccEventProto";
 
-service TxEventService {
-  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCompensateCommand) {
+import "GrpcCommon.proto";
+
+service TccEventService {
+  rpc participate(GrpcParticipateEvent) returns (GrpcAck) {}
+  rpc OnConnected (GrpcServiceConfig) returns (stream GrpcCordinateCommand) {
   }
-  rpc OnTxEvent (GrpcTxEvent) returns (GrpcAck) {}
+  rpc OnTransactionStarted (GrpcTransactionStartedEvent) returns (GrpcAck) {}
+  rpc OnTransactionEnded (GrpcTransactionEndedEvent) returns (GrpcAck) {}
   rpc OnDisconnected (GrpcServiceConfig) returns (GrpcAck) {
   }
 }
 
-message GrpcServiceConfig {
-  string serviceName = 1;
-  string instanceId = 2;
+message GrpcTransactionStartedEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
 }
 
-message GrpcAck {
-  bool aborted = 1;
+message GrpcParticipateEvent {
+  int64 timestamp = 1;
+  string globalTxId = 2;
+  string localTxId = 3;
+  string parentTxId = 4;
+  string confirmMethod = 6;
+  string cancelMethod = 7;
 }
 
-message GrpcTxEvent {
+message GrpcTransactionEndedEvent {
   int64 timestamp = 1;
   string globalTxId = 2;
   string localTxId = 3;
   string parentTxId = 4;
   string type = 5;
-  string compensationMethod = 6;
-  bytes payloads = 7;
-  string serviceName = 8;
-  string instanceId = 9;
-  int32 timeout = 10;
-  int32 retries = 11;
-  string retryMethod = 12;
 }
 
-message GrpcCompensateCommand {
+message GrpcCordinateCommand {
   string globalTxId = 1;
   string localTxId = 2;
   string parentTxId = 3;
-  string compensationMethod = 4;
-  bytes payloads = 5;
+  string type = 4;
 }
 
diff --git a/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto 
b/pack-contracts/pack-contract-grpc/src/main/proto/GrpcTxEvent.proto
index d2c6f77..f037b4f 100644
--- a/pack-contracts/pack-

[incubator-servicecomb-saga] 04/05: SCB-817 Added the License header

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

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

commit 29bfbdeef98c41559d16f565095d85951922cd21
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:06:20 2018 +0800

SCB-817 Added the License header
---
 .../transaction/tcc/TccStartAnnotationProcessor.java | 16 
 .../saga/omega/transaction/tcc/TccStartAspect.java   | 16 
 .../saga/omega/transaction/tcc/events/TccEndEvent.java   | 16 
 .../saga/omega/transaction/tcc/events/TccStartEvent.java | 16 
 4 files changed, 64 insertions(+)

diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
index b38d876..b93373f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAnnotationProcessor.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import javax.transaction.TransactionalException;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
index c8b7936..90728e3 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccStartAspect.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.servicecomb.saga.omega.transaction.tcc;
 
 import java.lang.invoke.MethodHandles;
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
index 1022aee..541489f 100644
--- 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/events/TccEndEvent.java
@@ -1,3 +1,19 @@
+/*
+ * 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 perm

[incubator-servicecomb-saga] branch master updated: Updated Readme file for the new added Omega plugins

2018-08-20 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 67f9b95  Updated Readme file for the new added Omega plugins
67f9b95 is described below

commit 67f9b95cfce86d5d0ea6cc3bf2c6704740bd1bdc
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:24:05 2018 +0800

Updated Readme file for the new added Omega plugins
---
 README.md| 7 +--
 README_ZH.md | 8 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 45ee3ef..07c3a3d 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,10 @@ Saga is composed of  **alpha** and **omega**.
 The following diagram shows the relationships among alpha, omega and services.
 ![Saga Pack Architecture](docs/static_files/pack.png)
 
-See [Saga Pack Design](docs/design.md) for details. 
+See [Saga Pack Design](docs/design.md) for details.
+
+Please check out Go lang version of Omega here 
https://github.com/jeremyxu2010/matrix-saga-go
+C# version of Omega here 
https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
 
 ## Get Started
 * For ServiceComb Java Chassis application, please see [Booking 
Demo](saga-demo/saga-servicecomb-demo/README.md) for details.
@@ -50,7 +53,7 @@ How to build and use can refer to [User 
Guide](docs/user_guide.md).
 
 ## Contact Us
 * [issues](https://issues.apache.org/jira/browse/SCB)
-* [gitter](https://gitter.im/ServiceCombUsers/Lobby)
+* [gitter](https://gitter.im/ServiceCombUsers/Saga)
 * mailing list: 
[subscribe](mailto:dev-subscr...@servicecomb.incubator.apache.org) 
[view](https://lists.apache.org/list.html?d...@servicecomb.apache.org)
 
 ## Contributing
diff --git a/README_ZH.md b/README_ZH.md
index 5bfc709..c4eb0f2 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -17,7 +17,11 @@ Saga是由 **alpha** 和 **omega**组成,其中:
 下图展示了alpha, omega以及微服务三者的关系:
 ![Saga Pack 架构](docs/static_files/pack.png)
 
-详情可浏览[Saga Pack 设计文档](docs/design_zh.md). 
+详情可浏览[Saga Pack 设计文档](docs/design_zh.md).
+
+Go语言版本Omega 可参见 https://github.com/jeremyxu2010/matrix-saga-go
+C#语言版本Omega 可参见 https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
+
 
 ## 快速入门
 * Saga在ServiceComb Java 
Chassis应用可以参考[出行预订](saga-demo/saga-servicecomb-demo/README.md)
@@ -52,7 +56,7 @@ JDK9或者JDK10 来编译Saga并运行测试的话,你需要使用 spring-boot
 
 ## 联系我们
 * [提交issues](https://issues.apache.org/jira/browse/SCB)
-* [gitter聊天室](https://gitter.im/ServiceCombUsers/Lobby)
+* [gitter聊天室](https://gitter.im/ServiceCombUsers/Saga)
 * 邮件列表: [订阅](mailto:dev-subscr...@servicecomb.incubator.apache.org) 
[浏览](https://lists.apache.org/list.html?d...@servicecomb.apache.org)
 
 ## 贡献



[incubator-servicecomb-saga] branch SCB-665 updated (c93373d -> 4efa3a9)

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

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


 discard c93373d  SCB-817 Updated the pack-contracts protocal for TCC
 discard 5a52f6e  SCB-817 Added TCC events in Omega part (WIP)
 discard e071a9b  SCB-817 Added TCC events in Omega part (WIP)
 add 8a2bcbe  SCB-852 Split akka related code to saga-core-akka
 add c1f0a10  SCB-852 Fixed the build error by adding saga-core-akka module
 add 089ffd7  SCB-852 Added the uncommitted pom of saga-core-akka
 add 7e586b5  SCB-853 Saga-core supports JDK7 now
 new 5b1ea96  SCB-817 Added TCC events in Omega part (WIP)
 new 0c16634  SCB-817 Added TCC events in Omega part (WIP)
 new 277ff27  SCB-817 Updated the pack-contracts protocal for TCC
 new 29bfbde  SCB-817 Added the License header
 new 4efa3a9  SCB-817 Updated the grpc file of TccEventService

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

 * -- * -- B -- O -- O -- O   (c93373d)
\
 N -- N -- N   refs/heads/SCB-665 (4efa3a9)

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

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

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


Summary of changes:
 .../tcc/TccStartAnnotationProcessor.java   | 16 ++
 .../saga/omega/transaction/tcc/TccStartAspect.java | 16 ++
 .../omega/transaction/tcc/events/TccEndEvent.java  | 16 ++
 .../transaction/tcc/events/TccStartEvent.java  | 16 ++
 .../src/main/proto/GrpcTccEvent.proto  | 18 +++
 pom.xml| 12 +
 {saga-core => saga-core-akka}/pom.xml  | 19 ++-
 .../saga/core/actors/ActorBasedSaga.java   |  2 +-
 .../saga/core/actors/ActorBasedSagaFactory.java|  0
 .../saga/core/actors/CompletionCallbackActor.java  |  0
 .../saga/core/actors/EventContextImpl.java |  0
 .../servicecomb/saga/core/actors/RequestActor.java |  0
 .../saga/core/actors/RequestActorBuilder.java  |  0
 .../saga/core/actors/RequestActorContext.java  |  0
 .../saga/core/actors/messages/AbortMessage.java|  0
 .../core/actors/messages/AbortRecoveryMessage.java |  0
 .../core/actors/messages/CompensateMessage.java|  0
 .../messages/CompensationRecoveryMessage.java  |  0
 .../saga/core/actors/messages/FailMessage.java |  0
 .../saga/core/actors/messages/Message.java |  0
 .../saga/core/actors/messages/TransactMessage.java |  1 +
 .../messages/TransactionRecoveryMessage.java   |  0
 .../ActorBasedSagaExecutionComponentTest.java  |  2 +-
 .../core/actors/ActorBasedSagaIntegrationTest.java | 16 +++---
 .../core/actors/CompletionCallbackActorTest.java   |  4 +-
 .../saga/core/actors/EventContextImplTest.java |  0
 .../saga/core/actors/RequestActorBuilderTest.java  |  2 +-
 .../saga/core/actors/RequestActorTest.java |  0
 .../src/test/resources/application.conf|  0
 .../src/test}/resources/log4j2.xml |  0
 saga-core/pom.xml  | 46 +---
 .../servicecomb/saga/core/BackwardRecovery.java|  5 ++
 .../apache/servicecomb/saga/core/Compensation.java | 32 +--
 .../saga/core/CompositeSagaResponse.java   | 31 ---
 .../apache/servicecomb/saga/core/Descriptive.java  |  4 +-
 .../org/apache/servicecomb/saga/core/Fallback.java | 17 +-
 .../servicecomb/saga/core/ForwardRecovery.java |  5 ++
 .../servicecomb/saga/core/GraphBasedSaga.java  | 15 +++---
 .../saga/core/LoggingRecoveryPolicy.java   |  5 ++
 .../servicecomb/saga/core/NoOpSagaRequest.java |  6 +++
 .../apache/servicecomb/saga/core/Operation.java|  8 +--
 .../servicecomb/saga/core/RestOperation.java   | 14 +++--
 .../apache/servicecomb/saga/core/SagaContext.java  |  4 +-
 .../servicecomb/saga/core/SagaContextImpl.java | 35 +++-
 .../apache/servicecomb/saga/core/SagaEvent.java|  5 ++
 .../apache/servicecomb/saga/core/SagaRequest.java  |  6 +--
 .../servicecomb/saga/core/SagaTaskFactory.java | 10 ++--
 .../apache/servicecomb/saga/core/Transaction.java  | 18 +++
 .../servicecomb/saga/core/TransactionConsumer.java |  5 ++
 .../saga/core/dag/ByLevelTraveller

[incubator-servicecomb-saga] 01/05: SCB-817 Added TCC events in Omega part (WIP)

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

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

commit 5b1ea9659b1c37a998450f6b49b59b94921efee9
Author: Willem Jiang 
AuthorDate: Sun Aug 12 11:16:22 2018 +0800

SCB-817 Added TCC events in Omega part (WIP)
---
 .../saga/omega/context/annotations/TccStart.java   | 15 +
 .../saga/omega/transaction/annotations/TCC.java| 64 ++
 .../saga/omega/transaction/tcc/TccAspect.java  | 48 
 .../saga/omega/transaction/tcc/TccInterceptor.java |  4 ++
 .../tcc/TccStartAnnotationProcessor.java   | 47 
 .../saga/omega/transaction/tcc/TccStartAspect.java | 60 
 .../omega/transaction/tcc/events/CancelEvent.java  | 20 +++
 .../omega/transaction/tcc/events/ConfirmEvent.java | 20 +++
 .../transaction/tcc/events/ParticipateEvent.java   | 21 +++
 .../tcc/events/TransactionEndEvent.java|  4 ++
 .../tcc/events/TransationStartEvent.java   |  4 ++
 11 files changed, 307 insertions(+)

diff --git 
a/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
new file mode 100644
index 000..c9154f9
--- /dev/null
+++ 
b/omega/omega-context/src/main/java/org/apache/servicecomb/saga/omega/context/annotations/TccStart.java
@@ -0,0 +1,15 @@
+package org.apache.servicecomb.saga.omega.context.annotations;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Indicates the annotated method will start a TCC .
+ */
+@Retention(RUNTIME)
+@Target(METHOD)
+public @interface TccStart {
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
new file mode 100644
index 000..a095978
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/annotations/TCC.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.omega.transaction.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.METHOD})
+/**
+ * Indicates the annotated method will start a sub-transaction. 
+ * A @TCC method should satisfy below requirements:
+ * 
+ *   all parameters are serialized
+ *   is idempotent
+ *   the object instance which @TCC method resides in should be 
stateless
+ * 
+ */
+public @interface TCC {
+  /**
+   * Confirm method name.
+   * A confirm method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String confirmMethod() default "";
+
+  /**
+   * Cancel method name.
+   * A cancel method should satisfy below requirements:
+   * 
+   *   has same parameter list as @TCC method's
+   *   all parameters are serialized
+   *   is idempotent
+   *   be in the same class as @TCC method is in
+   * 
+   *
+   * @return
+   */
+  String cancelMethod() default "";
+
+}
diff --git 
a/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
new file mode 100644
index 000..173cb78
--- /dev/null
+++ 
b/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccAspect.java
@@ -0,0 +1,48 @@
+package org.apache.servicecomb.saga.omega.transaction.tcc;
+
+import java.lang.invoke.MethodH

[incubator-servicecomb-website] branch master updated: add english version release note of 1.0.0

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 830e23d  add english version release note of 1.0.0
830e23d is described below

commit 830e23dcf95090cb4c677f19f7ca94e2531d616c
Author: Wang Kirin 
AuthorDate: Mon Aug 20 17:37:35 2018 +0800

add english version release note of 1.0.0
---
 _pages/home.md |  18 ++
 _posts/2018-8-20-release-note-1-0-0.md | 102 +
 2 files changed, 108 insertions(+), 12 deletions(-)

diff --git a/_pages/home.md b/_pages/home.md
old mode 100644
new mode 100755
index 23669e3..476a345
--- a/_pages/home.md
+++ b/_pages/home.md
@@ -20,33 +20,27 @@ intro:
 Latest News
 
 
-  
-Microservice Meetup: 
Apache ServiceComb (incubating) Day slides 
+
+[Milestone] Apache ServiceComb (incubating) Release 
Version 1.0.0
   
   
-ServiceComb announces it's first Apache Incubating 
Release to the community.
+Microservice Meetup: 
Apache ServiceComb (incubating) Day slides 
   
   
 ServiceComb now provides data 
consistency solutions(Saga) in microservice application.
   
-  
-Join us at Gitter
-  
 
 
 
   
-Java-Chassis releases a new 
version 1.0.0
-  
-  
-Service-Center releases a new 
version 1.0.0
-  
-  
 Saga releases a new version 0.2.0
   
   
 Service-Center 
Frontend can be used to test microservices schema directly from web.
   
+
+Join us at Gitter
+  
 
 "
 
diff --git a/_posts/2018-8-20-release-note-1-0-0.md 
b/_posts/2018-8-20-release-note-1-0-0.md
new file mode 100755
index 000..c5bbe21
--- /dev/null
+++ b/_posts/2018-8-20-release-note-1-0-0.md
@@ -0,0 +1,102 @@
+---
+title: "[Milestone] Apache ServiceComb (incubating) Release Version 1.0.0"
+lang: en
+ref: release-note-1-0-0
+permalink: /docs/release-note-1-0-0/
+excerpt: "Apache ServiceComb (incubating) enters new stage"
+last_modified_at: 2018-06-14T10:26:28+08:00
+author: Wang Kirin
+tags: [microservice, version, release]
+redirect_from:
+  - /theme-setup/
+---
+
+
+​  Recently,  the Apache Foundation Incubation Project - Apache 
ServiceComb (incubating) officially released its  1.0.0 version  through 
community voting. The release this time includes Apache ServiceComb 
Java-Chassis (hereinafter referred to as Java-chassis) and Apache ServiceComb 
ServiceCenter (hereinafter referred to as ServiceCenter). 
+
+​  ServiceComb has entered the Apache Foundation since December 2017, and 
version 1.0.0-m1 released in March 2018  , 1.0.0-m2 in  June 2018 . Now in 
August 2018, the milestone of release -1.0.0  was completed.
+
+​   At present, 10+ companies have used ServiceComb for commercial use, 
the ServiceComb team has already participated in 10+ Meetups to give a speech. 
Besides, the ServiceComb community also  held 3 Meetups. The release of version 
1.0.0 this time means that the ServiceComb version has officially entered a 
stable state on the premise of meeting the requirements of the Apache Software 
Foundation. The main new features and enhancements of ServiceComb Java-chassis 
and Service-center after ent [...]
+
+
+## Java-chassis
+
+- New Metrics module; Added a large number of monitoring indicators; Support 
Prometheus integration 
+- Re-org the configuration center, support docking Ctrip Apollo as a 
configuration center, and easily extend the docking of other three-party 
configuration centers 
+- The POJO programming model allows users to use CompletableFuture 
asynchronous programming 
+- The POJO programming model allows users to use Object and Generic types as 
invoke parameters 
+- Upgrade Zipkin to Zipkin2, and support both v1 and v2 versions of Zipkin 
server 
+- Micro-service communication provides file stream capability and supports 
multimedia scenes such as music and pictures 
+-  Added support for API level QPS control based on service level QPS control;
+  - Now we support using 
`servicecomb.flowcontrol.Consumer.qps.limit.[ServiceName].[Schema].[operation]` 
to config the API level QPS control 
+- Added  `scaffold` and [start.servicecomb.io](http://start.servicecomb.io) to 
allow users quickly build projects and provide complete out-of-the-box 
capabilities
+  -  Now create a ServiceComb microservice can be quickly built by Apache 
Maven Archetype. For more details, please refer to [ServiceComb Java Chassis 
Archetypes](https://github.com/apache/incubator-servicecomb-java-chassis/blob/master/archetypes/README.md)
 , or you can directly access 
[start.servicecomb.io](http://start.servicecomb.io)  to use the  `SPRING 
INITIALIZR UI` intergated by ServiceComb .
+
+- Added a demonstration of how to build a ServiceComb project using `Gradle`
+- We added the Gradle configuration to the 
[BMI](https://github.com/apache/i

[incubator-servicecomb-website] branch asf-site updated (44bb2b9 -> 2cd7cc6)

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

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


from 44bb2b9  Publish the website
 add 830e23d  add english version release note of 1.0.0
 new 66bcb89  Merge branch 'master' into asf-site
 new 2cd7cc6  Publish the website

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


Summary of changes:
 _pages/home.md |  18 +-
 _posts/2018-8-20-release-note-1-0-0.md | 102 +
 .../docs/apache-servicecomb-day-slides/index.html  |  22 +-
 .../apache-servicecomb-incubating-day/index.html   |  22 +-
 content/cn/docs/autoscale-on-company/index.html|  22 +-
 .../index.html |  22 +-
 content/cn/docs/communication-btw-sc-ms/index.html |  22 +-
 content/cn/docs/company-on-kubernetes/index.html   |  22 +-
 .../cn/docs/config_center_integration/index.html   |  22 +-
 content/cn/docs/consul-servicemesh.html|  22 +-
 .../index.html |  22 +-
 content/cn/docs/distributed_saga_1/index.html  |  22 +-
 content/cn/docs/distributed_saga_2/index.html  |  22 +-
 content/cn/docs/distributed_saga_3/index.html  |  22 +-
 .../index.html |  22 +-
 .../index.html |  22 +-
 .../index.html |  22 +-
 .../index.html |  22 +-
 content/cn/docs/go-to-cloud/index.html |  22 +-
 .../index.html |  22 +-
 .../docs/how-to-reform-a-legacy-system/index.html  |  22 +-
 content/cn/docs/jira_beginner_guide/index.html |  22 +-
 content/cn/docs/join_the_community/index.html  |  22 +-
 content/cn/docs/linuxcon-workshop-demo/index.html  |  22 +-
 .../cn/docs/maven_dependency_management/index.html |  22 +-
 content/cn/docs/open-design/index.html |  22 +-
 .../index.html |  22 +-
 content/cn/docs/release_note_1_0_0.html|  25 +-
 content/cn/docs/saga_pack_design/index.html|  22 +-
 content/cn/docs/saga_with_cucumber/index.html  |  22 +-
 .../seckill-development-journey-part-I/index.html  |  22 +-
 .../seckill-development-journey-part-II/index.html |  22 +-
 .../index.html |  22 +-
 .../index.html |  22 +-
 .../cn/docs/tracing-with-servicecomb/index.html|  22 +-
 .../index.html |  22 +-
 .../apache-servicecomb-incubating-day/index.html   |  22 +-
 content/docs/autoscale-on-company/index.html   |  22 +-
 content/docs/communication-btw-sc-ms/index.html|  22 +-
 content/docs/company-on-kubernetes/index.html  |  22 +-
 content/docs/distributed_saga_1/index.html |  22 +-
 content/docs/distributed_saga_2/index.html |  22 +-
 content/docs/distributed_saga_3/index.html |  22 +-
 content/docs/go-to-cloud/index.html|  22 +-
 .../docs/how-to-reform-a-legacy-system/index.html  |  22 +-
 content/docs/howto-upgrade-topzipkin2/index.html   |  22 +-
 content/docs/linuxcon-workshop-demo/index.html |  22 +-
 .../index.html | 203 +++---
 .../seckill-development-journey-part-I/index.html  |  22 +-
 .../seckill-development-journey-part-II/index.html |  22 +-
 .../index.html |  22 +-
 content/docs/service-center-ui/index.html  |  22 +-
 .../service-registry-refactor-proposal/index.html  |  22 +-
 .../index.html |  22 +-
 content/docs/tracing-with-servicecomb/index.html   |  22 +-
 content/feed.xml   | 445 ++---
 content/index.html |   4 +-
 content/sitemap.xml|   4 +
 content/sitemap/index.html |   2 +
 content/year-archive/index.html| 168 
 60 files changed, 1119 insertions(+), 974 deletions(-)
 mode change 100644 => 100755 _pages/home.md
 create mode 100755 _posts/2018-8-20-release-note-1-0-0.md
 copy content/docs/{apache-servicecomb-incubating-day-report => 
release-note-1-0-0}/index.html (62%)



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

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

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

commit 66bcb89a8c00dddb15d7657ede356fc763aab02b
Merge: 44bb2b9 830e23d
Author: Willem Jiang 
AuthorDate: Mon Aug 20 18:03:07 2018 +0800

Merge branch 'master' into asf-site

 _pages/home.md |  18 ++
 _posts/2018-8-20-release-note-1-0-0.md | 102 +
 2 files changed, 108 insertions(+), 12 deletions(-)



[incubator-servicecomb-saga] branch master updated: Fix the formate issue README

2018-08-20 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 13e5646  Fix the formate issue README
13e5646 is described below

commit 13e5646a11f75c2c477da12465f074ad4bb1aaad
Author: Willem Jiang 
AuthorDate: Mon Aug 20 19:47:53 2018 +0800

Fix the formate issue README
---
 README.md| 4 ++--
 README_ZH.md | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 07c3a3d..eb009f4 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@ The following diagram shows the relationships among alpha, 
omega and services.
 
 See [Saga Pack Design](docs/design.md) for details.
 
-Please check out Go lang version of Omega here 
https://github.com/jeremyxu2010/matrix-saga-go
-C# version of Omega here 
https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
+* Go lang version of Omega here https://github.com/jeremyxu2010/matrix-saga-go
+* C# version of Omega here 
https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
 
 ## Get Started
 * For ServiceComb Java Chassis application, please see [Booking 
Demo](saga-demo/saga-servicecomb-demo/README.md) for details.
diff --git a/README_ZH.md b/README_ZH.md
index c4eb0f2..0531441 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -19,8 +19,8 @@ Saga是由 **alpha** 和 **omega**组成,其中:
 
 详情可浏览[Saga Pack 设计文档](docs/design_zh.md).
 
-Go语言版本Omega 可参见 https://github.com/jeremyxu2010/matrix-saga-go
-C#语言版本Omega 可参见 https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
+* Go语言版本Omega 可参见 https://github.com/jeremyxu2010/matrix-saga-go
+* C#语言版本Omega 可参见 https://github.com/OpenSagas-csharp/servicecomb-saga-csharp
 
 
 ## 快速入门



[incubator-servicecomb-docs] branch master updated: Using java chassis in spring boot dir translation (#40)

2018-08-27 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-docs.git


The following commit(s) were added to refs/heads/master by this push:
 new 31e6c81  Using java chassis in spring boot dir translation (#40)
31e6c81 is described below

commit 31e6c810ebf4dfa9cab650acfe394e660952cb9b
Author: lidian 
AuthorDate: Mon Aug 27 16:53:53 2018 +0800

Using java chassis in spring boot dir translation (#40)
---
 .../diff-between-java-web.md   |   3 +-
 .../diff-spring-mvc.md | 106 ++---
 .../java-application.md|  27 +++---
 .../web-application.md |  33 ---
 .../java-application.md|   2 +-
 5 files changed, 82 insertions(+), 89 deletions(-)

diff --git 
a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-between-java-web.md
 
b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-between-java-web.md
index 180d66e..b6dc562 100644
--- 
a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-between-java-web.md
+++ 
b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-between-java-web.md
@@ -1,2 +1 @@
-两种开发方式都会启用java 
chassis的全量功能,JAVA应用方式运行于独立的HTTP服务器(基于vert.x构建)上,性能上存在很大的优势。Web开发方式运行于Tomcat或者其他内置的Web服务器之上,作为一个Servlet接收请求,因此在开发过程中,可以使用Web容器提供的一些功能,比如提供页面服务,使用Filter等。当应用只需要提供REST服务,并且对性能要求很高的场景,建议使用JAVA应用方式。
-
+Both development methods will enable the full functionality of the java 
chassis. The JAVA application mode runs on a separate HTTP server (based on 
vert.x), which has great advantages in performance. The web development method 
runs on Tomcat or other built-in web servers and receives requests as a 
servlet. Therefore, during the development process, you can use some functions 
provided by the web container, such as providing page services and using 
Filter. When the application only needs t [...]
diff --git 
a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md
 
b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md
index a0e9c13..97e31d9 100644
--- 
a/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md
+++ 
b/java-chassis-reference/en_US/using-java-chassis-in-spring-boot/diff-spring-mvc.md
@@ -1,73 +1,73 @@
-java chassis支持使用Spring 
MVC提供的标签\(org.springframework.web.bind.annotation\)来声明REST接口,但是两者是独立的实现,而且有不一样的设计目标。java
 chassis的目标是提供跨语言、支持多通信协议的框架,因此去掉了Spring 
MVC中一些对跨语言支持不是很好的特性,也不支持特定运行框架强相关的特性,比如直接访问Servlet协议定义的HttpServletRequest。下面是一些显著的差别。
 
-* 服务声明方式
+Java chassis supports the use of the label 
\(org.springframework.web.bind.annotation\) provided by Spring MVC to declare 
the REST interface, but the two are independent implementations and have 
different design goals. The goal of the java chassis is to provide a 
cross-language framework that supports multiple communication protocols. 
Therefore, some features of Spring MVC that are not very good for 
cross-language support are removed, and features that are strongly related to a 
specific r [...]
 
-Spring MVC使用@RestController声明服务,而java 
chassis使用@RestSchema声明服务,并且需要显示的使用@RequestMapping声明服务路径,以区分该服务是采用Spring 
MVC的标签还是使用JAX RS的标签。
+* Service declaration method
+
+Spring MVC uses @RestController to declare the service, and java chassis uses 
@RestSchema to declare the service and needs to display the service path using 
@RequestMapping to distinguish whether the service uses Spring MVC Annotations 
or JAX RS Annotations.
 
 ```
 @RestSchema(schemaId = "hello")
 @RequestMapping(path = "/")
 ```
 
-Schema是java 
chassis的服务契约,是服务运行时的基础,服务治理、编解码等都基于契约进行。在跨语言的场景,契约也定义了不同语言能够同时理解的部分。
+The schema is the service contract of java chassis, which is the basis of 
service runtime. Service management, codec and so on are all based on contract. 
In a cross-language scenario, the contract also defines the parts of the 
language that can be understood simultaneously.
 
-* 数据类型支持
+* Data type support
 
-采用Spring MVC,可以在服务定义中使用多种数据类型,只要这种数据类型能够被json序列化和反序列化。比如:
+With Spring MVC, you can use multiple data types in a service definition as 
long as it can be serialized and deserialized by json. Such as:
 
 ```
-// 抽象类型
-public void postData(@RequestBody Object data)
-// 接口定义
-public void postData(@RequestBody IPerson interfaceData)
-// 没指定类型的泛型
-public void postData(@RequestBody Map rawData)
-// 具体协议相关的类型
-public void postData(HttpServletRequest rquest)
+// abstract type
+Public void postData(@RequestBody Object data)
+// Interface definition
+Public void postData(@RequestBody IPerson interfaceData)
+//  Generics tpye without specified type
+Public void postData(@RequestBody Map rawData)
+// specific protocol related types
+Public void postData(HttpServletRequest request)
 ```
 
-上面的类型在java chassis都不提供支持。因为java 
chassis会根据接

[incubator-servicecomb-website] branch asf-site updated: Added the updated ServiceComb logo

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

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


The following commit(s) were added to refs/heads/asf-site by this push:
 new 172b0d5  Added the updated ServiceComb logo
172b0d5 is described below

commit 172b0d577dc826701801c62832ed9751c6cacd38
Author: Willem Jiang 
AuthorDate: Mon Aug 27 18:24:10 2018 +0800

Added the updated ServiceComb logo
---
 content/assets/images/ServiceComb-logo.png | Bin 0 -> 6109 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/content/assets/images/ServiceComb-logo.png 
b/content/assets/images/ServiceComb-logo.png
new file mode 100755
index 000..e06f651
Binary files /dev/null and b/content/assets/images/ServiceComb-logo.png differ



[incubator-servicecomb-website] branch asf-site updated (172b0d5 -> 971aba4)

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

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


from 172b0d5  Added the updated ServiceComb logo
 add d22793b  update website
 add 8d06c99  change latest release
 add 4fd0e3f  Updated the release page
 new 49b606e  Merge branch 'master' into asf-site
 new 971aba4  Publish the website

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


Summary of changes:
 _release/cn/release.md| 16 
 _release/release.md   | 16 
 content/cn/release/index.html | 14 +++---
 content/feed.xml  |  2 +-
 content/release/index.html| 14 +++---
 5 files changed, 31 insertions(+), 31 deletions(-)



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

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

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

commit 49b606e775d8b5c4452bb79beb67a2479a1e0574
Merge: 172b0d5 4fd0e3f
Author: Willem Jiang 
AuthorDate: Mon Aug 27 18:53:33 2018 +0800

Merge branch 'master' into asf-site

 _release/cn/release.md | 16 
 _release/release.md| 16 
 2 files changed, 16 insertions(+), 16 deletions(-)



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

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

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

commit 971aba4dbd8a097d469892e49afceb1e0939f6e0
Author: Willem Jiang 
AuthorDate: Mon Aug 27 18:54:53 2018 +0800

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

diff --git a/content/cn/release/index.html b/content/cn/release/index.html
index 6aa8d54..31cce28 100644
--- a/content/cn/release/index.html
+++ b/content/cn/release/index.html
@@ -367,7 +367,7 @@
   
 
   
-Use the links below to download the Apache ServiceComb Incubating 
from one of our mirrors. You must verify the integrity of the downloaded files 
using signatures downloaded from our main distribution directory.
+Use the links below to download the ServiceComb releases from one 
of our mirrors. You must verify the integrity of the downloaded files using 
signatures downloaded from our main distribution directory.
 
 Only current recommended releases are available on the main distribution 
site and its mirrors.
 
@@ -413,16 +413,16 @@
 Verifying the release
 
 It is essential that you verify the integrity of the downloaded files using 
the PGP or SHA signatures.
- The PGP signatures can  be verified using GPG or PGP. 
+ The PGP signatures can  be verified using GPG or PGP.
  Please download the https://www.apache.org/dist/incubator/servicecomb/KEYS; 
target="_blank">KEYS as well as the asc signature files for relevant 
distribution. It is recommended to get these files from the main distribution 
https://www.apache.org/dist/incubator/servicecomb/; 
target="_blank">directory and not from the mirrors.
  gpg -i KEYS
- 
+
  or
- 
+
  pgpk -a KEYS
- 
+
  or
- 
+
  pgp -ka KEYS
 
 
@@ -436,7 +436,7 @@ or
 
 pgpv apache-servicecomb-incubating.asc
 
-or 
+or
 
 pgp apache-servicecomb-incubating.asc
 
diff --git a/content/feed.xml b/content/feed.xml
index bc3c722..905195a 100644
--- a/content/feed.xml
+++ b/content/feed.xml
@@ -1,4 +1,4 @@
-http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-08-27T17:44:19+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
+http://www.w3.org/2005/Atom; >https://jekyllrb.com/; 
version="3.4.3">Jekyll2018-08-27T18:54:07+08:00/Apache ServiceComb (incubating)The homepage of 
ServiceComb{name=nil, 
avatar= [...]
 
 p​ ServiceComb has entered the Apache Foundation since December 
2017, and version 1.0.0-m1 released in March 2018  , 1.0.0-m2 in  June 2018 . 
Now in August 2018, the milestone of release -1.0.0  was completed./p
 
diff --git a/content/release/index.html b/content/release/index.html
index 263e82d..f550246 100644
--- a/content/release/index.html
+++ b/content/release/index.html
@@ -366,7 +366,7 @@
   
 
   
-Use the links below to download the Apache ServiceComb Incubating 
from one of our mirrors. You must verify the integrity of the downloaded files 
using signatures downloaded from our main distribution directory.
+Use the links below to download the ServiceComb releases from one 
of our mirrors. You must verify the integrity of the downloaded files using 
signatures downloaded from our main distribution directory.
 
 Only current recommended releases are available on the main distribution 
site and its mirrors.
 
@@ -411,16 +411,16 @@
 Verifying the release
 
 It is essential that you verify the integrity of the downloaded files using 
the PGP or SHA signatures.
- The PGP signatures can  be verified using GPG or PGP. 
+ The PGP signatures can  be verified using GPG or PGP.
  Please download the https://www.apache.org/dist/incubator/servicecomb/KEYS; 
target="_blank">KEYS as well as the asc signature files for relevant 
distribution. It is recommended to get these files from the main distribution 
https://www.apache.org/dist/incubator/servicecomb/; 
target="_blank">directory and not from the mirrors.
  gpg -i KEYS
- 
+
  or
- 
+
  pgpk -a KEYS
- 
+
  or
- 
+
  pgp -ka KEYS
 
 
@@ -434,7 +434,7 @@ or
 
 pgpv apache-servicecomb-incubating.asc
 
-or 
+or
 
 pgp apache-servicecomb-incubating.asc
 



<    3   4   5   6   7   8   9   10   11   12   >