You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2018/05/26 08:24:18 UTC

[incubator-servicecomb-saga] branch SCB-555 created (now 94606f7)

This is an automated email from the ASF dual-hosted git repository.

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


      at 94606f7  SCB-555 Clean up the dock-componse file

This branch includes the following new commits:

     new f012bf7  SCB-555 Add saga-dubbo-demo It also shows verify the error of SCB-547 click 7.[A.run->B.run, B.run->C.run(x), C.run exception], and org.apache.servicecomb.saga.alpha.core.EventScanner.pollEvents scheduler will stop running. TODO: add acceptance test (cucumber)
     new 07fb16e  SCB-555 Add saga-dubbo-demo README
     new 78883e7  SCB-555 Add acceptance test for dubbo demo
     new f6d4cd9  fix result events unorder
     new 3273eaf  add module saga-dubbo-demo
     new e1119d0  saga-dubbo-demo add docker plugin(part1)
     new 0a2b578  revert first
     new 8c56cf0  docker plugin for mvn test
     new f45d559  modify readme
     new 1f79da3  SCB-555 Updated the log setting to info level
     new ca56d95  SCB-555 Fixed the test error with spring boot 2
     new 94606f7  SCB-555 Clean up the dock-componse file

The 12 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.


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

[incubator-servicecomb-saga] 03/12: SCB-555 Add acceptance test for dubbo demo

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 78883e70973634a41c72f63bf10dbb53c3899177
Author: wuzunqian <wu...@msn.com>
AuthorDate: Mon May 7 22:23:34 2018 +0800

    SCB-555 Add acceptance test for dubbo demo
    
    add license
---
 acceptance-tests/acceptance-dubbo-demo/pom.xml     |  45 ++++++
 .../acceptance/dubbodemo/DubboDemoStepdefs.java    | 170 +++++++++++++++++++++
 .../saga/acceptance/dubbodemo/RunCucumberIT.java   |  27 ++++
 .../resources/AExceptionWhenAb_scenario.feature    |  41 +++++
 .../test/resources/AbAc_success_scenario.feature   |  47 ++++++
 .../test/resources/AbBc_success_scenario.feature   |  47 ++++++
 .../src/test/resources/Ab_success_scenario.feature |  40 +++++
 .../resources/BExceptionWhenAb_scenario.feature    |  40 +++++
 .../resources/CExceptionWhenAbAc_scenario.feature  |  48 ++++++
 .../resources/CExceptionWhenAbBc_scenario.feature  |  47 ++++++
 .../src/test/resources/log4j2-test.xml             |  30 ++++
 acceptance-tests/pom.xml                           |   8 +
 saga-demo/saga-dubbo-demo/README.md                |   5 +-
 .../servicecomb/saga/demo/dubbo/pub/ServiceVO.java |  48 ++++++
 .../dubbo/servicea/web/DubboDemoController.java    |  16 +-
 15 files changed, 654 insertions(+), 5 deletions(-)

diff --git a/acceptance-tests/acceptance-dubbo-demo/pom.xml b/acceptance-tests/acceptance-dubbo-demo/pom.xml
new file mode 100644
index 0000000..023a2d8
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="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">
+    <parent>
+        <artifactId>acceptance-tests</artifactId>
+        <groupId>org.apache.servicecomb.saga</groupId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <name>Saga:Acceptance Tests::DubboDemo</name>
+    <artifactId>acceptance-dubbo-demo</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+            <version>${jackson.version}</version>
+        </dependency>
+    </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
new file mode 100644
index 0000000..af6b7d1
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
@@ -0,0 +1,170 @@
+/*
+ * 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.acceptance.dubbodemo;
+
+import cucumber.api.DataTable;
+import cucumber.api.java.After;
+import cucumber.api.java.Before;
+import cucumber.api.java8.En;
+import io.restassured.response.Response;
+import org.hamcrest.core.StringContains;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.invoke.MethodHandles;
+import java.util.*;
+import java.util.function.Consumer;
+
+import static io.restassured.RestAssured.given;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.apache.commons.lang3.StringUtils.isEmpty;
+import static org.awaitility.Awaitility.await;
+import static org.hamcrest.core.Is.is;
+
+public class DubboDemoStepdefs implements En {
+  private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private static final String ALPHA_REST_ADDRESS = "alpha.rest.address";
+  private static final String SERVICEA_ADDRESS = "servicea.address";
+  private static final String SERVICEB_ADDRESS = "serviceb.address";
+  private static final String SERVICEC_ADDRESS = "servicec.address";
+  private static final String INFO_SERVICE_URI = "info.service.uri";
+
+  private static final Consumer<Map<String, String>[]> NO_OP_CONSUMER = (dataMap) -> {
+  };
+
+  public DubboDemoStepdefs() {
+    Given("^ServiceA is up and running$", () -> {
+      probe(System.getProperty(SERVICEA_ADDRESS));
+    });
+
+    And("^ServiceB is up and running$", () -> {
+      probe(System.getProperty(SERVICEB_ADDRESS));
+    });
+
+    And("^ServiceC is up and running$", () -> {
+      probe(System.getProperty(SERVICEC_ADDRESS));
+    });
+
+    And("^Alpha is up and running$", () -> {
+      probe(System.getProperty(ALPHA_REST_ADDRESS));
+    });
+
+    When("^([A-Za-z]+) :: .*$", (invokeCode) -> {
+      LOG.info("invokeCode: " + invokeCode);
+
+      Response resp = given()
+          .pathParam("invokeCode", invokeCode)
+          .when()
+          .get(System.getProperty(SERVICEA_ADDRESS) + "/serviceInvoke/{invokeCode}");
+      LOG.info("response status code:" + resp.statusCode());
+      resp.then().content(new StringContains("check result: true"));
+    });
+
+    Then("^Alpha records the following events$", (DataTable dataTable) -> {
+      Consumer<Map<String, Object>[]> sortAndColumnStrippingConsumer = dataMap -> {
+        //sort first
+        Arrays.sort(dataMap, (o1, o2) -> {
+          Integer id1 = (Integer)o1.get("surrogateId");
+          Integer id2 = (Integer)o2.get("surrogateId");
+          if(id1 == null || id2 == null) return 0;
+          return id1.compareTo(id2);
+        });
+        //strip columns
+        for (Map<String, Object> map : dataMap)
+          map.keySet().retainAll(dataTable.topCells());
+      };
+
+      dataMatches(System.getProperty(ALPHA_REST_ADDRESS) + "/events", dataTable, sortAndColumnStrippingConsumer);
+    });
+
+    And("^(service[a-c]+) success update status$", (String serviceName, DataTable dataTable) -> {
+      Consumer<Map<String, Object>[]> columnStrippingConsumer = dataMap -> {
+        for (Map<String, Object> map : dataMap)
+          map.keySet().retainAll(dataTable.topCells());
+      };
+
+      dataMatches(System.getProperty(SERVICEA_ADDRESS) + "/serviceInfo/"+serviceName, dataTable, columnStrippingConsumer);
+    });
+  }
+
+  @Before
+  public void cleanUp() {
+    LOG.info("Cleaning up services");
+
+    given()
+            .when()
+            .delete(System.getProperty(ALPHA_REST_ADDRESS) + "/events")
+            .then()
+            .statusCode(is(200));
+  }
+
+  @SuppressWarnings("unchecked")
+  private void dataMatches(String address, DataTable dataTable, Consumer<Map<String, Object>[]> dataProcessor) {
+    List<Map<String, Object>> expectedMaps = dataTable.asMaps(String.class, Object.class);
+    List<Map<String, Object>> actualMaps = new ArrayList<>();
+
+    await().atMost(8, SECONDS).until(() -> {
+      actualMaps.clear();
+      Collections.addAll(actualMaps, retrieveDataMaps(address, dataProcessor));
+
+      return expectedMaps.size() == actualMaps.size();
+    });
+
+    if (expectedMaps.isEmpty() && actualMaps.isEmpty()) {
+      return;
+    }
+
+    LOG.info("Retrieved data {} from service", actualMaps);
+    dataTable.diff(DataTable.create(actualMaps));
+  }
+
+  @SuppressWarnings("unchecked")
+  private Map<String, Object>[] retrieveDataMaps(String address, Consumer<Map<String, Object>[]> dataProcessor) {
+    Map<String, Object>[] dataMap = given()
+        .when()
+        .get(address)
+        .then()
+        .statusCode(is(200))
+        .extract()
+        .body()
+        .as(Map[].class);
+
+    dataProcessor.accept(dataMap);
+    return dataMap;
+  }
+
+  private void probe(String address) {
+    String infoURI = System.getProperty(INFO_SERVICE_URI);
+    if (isEmpty(infoURI)) {
+      infoURI = "/info";
+    }
+    LOG.info("The info service uri is " + infoURI);
+    probe(address, infoURI);
+  }
+
+  private void probe(String address, String infoURI) {
+    LOG.info("Connecting to service address {}", address);
+    given()
+        .when()
+        .get(address + infoURI)
+        .then()
+        .statusCode(is(200));
+  }
+
+}
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/RunCucumberIT.java b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/RunCucumberIT.java
new file mode 100644
index 0000000..caf974c
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/RunCucumberIT.java
@@ -0,0 +1,27 @@
+/*
+ * 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.acceptance.dubbodemo;
+import cucumber.api.CucumberOptions;
+import cucumber.api.junit.Cucumber;
+import org.junit.runner.RunWith;
+
+@RunWith(Cucumber.class)
+@CucumberOptions(plugin = {"pretty", "html:target/cucumber"},
+    features = "src/test/resources")
+public class RunCucumberIT {
+}
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature
new file mode 100644
index 0000000..2be4378
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature
@@ -0,0 +1,41 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, A.run exception after A call B.run
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And Alpha is up and running
+
+    When AExceptionWhenAb :: A->B, A.run exception after A call B.run
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | serviceb   | TxEndedEvent   |
+      | servicea   | TxAbortedEvent     |
+      | serviceb | TxCompensatedEvent   |
+      | serviceb | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | init |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | cancel |
\ No newline at end of file
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature
new file mode 100644
index 0000000..9ba638e
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature
@@ -0,0 +1,47 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, A->C success
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And ServiceC is up and running
+    And Alpha is up and running
+
+    When AbAc :: A->B, A->C, success
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | serviceb | TxEndedEvent   |
+      | servicec | TxStartedEvent   |
+      | servicec | TxEndedEvent   |
+      | servicea | TxEndedEvent   |
+      | servicea | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | run |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | run |
+
+    And servicec success update status
+      | service | vstatus |
+      | servicec | run |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature
new file mode 100644
index 0000000..1af54fc
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature
@@ -0,0 +1,47 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, B->C, success
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And ServiceC is up and running
+    And Alpha is up and running
+
+    When AbBc :: A->B, B->C, success
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | servicec | TxStartedEvent   |
+      | servicec | TxEndedEvent   |
+      | serviceb | TxEndedEvent   |
+      | servicea | TxEndedEvent   |
+      | servicea | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | run |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | run |
+
+    And servicec success update status
+      | service | vstatus |
+      | servicec | run |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature
new file mode 100644
index 0000000..3313bb4
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature
@@ -0,0 +1,40 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, success
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And Alpha is up and running
+
+    When Ab :: A->B, success
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | serviceb   | TxEndedEvent   |
+      | servicea   | TxEndedEvent     |
+      | servicea | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | run |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | run |
\ No newline at end of file
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature
new file mode 100644
index 0000000..65d1d8f
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature
@@ -0,0 +1,40 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, B.run exception
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And Alpha is up and running
+
+    When BExceptionWhenAb :: A->B, B.run exception
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | serviceb   | TxAbortedEvent   |
+      | servicea   | TxAbortedEvent     |
+      | servicea | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | init |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | init |
\ No newline at end of file
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature
new file mode 100644
index 0000000..689b4f1
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature
@@ -0,0 +1,48 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B,A->C, C.run exception
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And ServiceC is up and running
+    And Alpha is up and running
+
+    When CExceptionWhenAbAc :: A->B,A->C, C.run exception
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | serviceb | TxEndedEvent   |
+      | servicec | TxStartedEvent   |
+      | servicec | TxAbortedEvent   |
+      | servicea | TxAbortedEvent   |
+      | serviceb | TxCompensatedEvent   |
+      | serviceb | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | init |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | cancel |
+
+    And servicec success update status
+      | service | vstatus |
+      | servicec | init |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature
new file mode 100644
index 0000000..54fa1f9
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature
@@ -0,0 +1,47 @@
+# 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.
+
+Feature: Alpha records transaction events
+
+  Scenario: A->B, B->C, C.run exception
+    Given ServiceA is up and running
+    And ServiceB is up and running
+    And ServiceC is up and running
+    And Alpha is up and running
+
+    When CExceptionWhenAbBc :: A->B, B->C, C.run exception
+
+    Then Alpha records the following events
+      | serviceName  | type             |
+      | servicea | SagaStartedEvent |
+      | servicea     | TxStartedEvent   |
+      | serviceb    | TxStartedEvent     |
+      | servicec | TxStartedEvent   |
+      | servicec | TxAbortedEvent   |
+      | serviceb | TxAbortedEvent   |
+      | servicea | TxAbortedEvent   |
+      | servicea | SagaEndedEvent   |
+
+    And servicea success update status
+      | service | vstatus |
+      | servicea | init |
+
+    And serviceb success update status
+      | service | vstatus |
+      | serviceb | init |
+
+    And servicec success update status
+      | service | vstatus |
+      | servicec | init |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/log4j2-test.xml b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/log4j2-test.xml
new file mode 100644
index 0000000..58924c6
--- /dev/null
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/log4j2-test.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <Root level="info">
+      <AppenderRef ref="Console"/>
+    </Root>
+  </Loggers>
+</Configuration>
diff --git a/acceptance-tests/pom.xml b/acceptance-tests/pom.xml
index 51b4d86..572d949 100644
--- a/acceptance-tests/pom.xml
+++ b/acceptance-tests/pom.xml
@@ -31,6 +31,7 @@
   <packaging>pom</packaging>
   <modules>
     <module>acceptance-pack</module>
+    <module>acceptance-dubbo-demo</module>
   </modules>
 
   <properties>
@@ -83,6 +84,13 @@
       <groupId>org.awaitility</groupId>
       <artifactId>awaitility</artifactId>
     </dependency>
+    <!--fix: java.lang.NoClassDefFoundError: groovy/lang/GroovyObject-->
+    <dependency>
+      <groupId>org.codehaus.groovy</groupId>
+      <artifactId>groovy</artifactId>
+      <version>2.4.15</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>
diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md
index 1565b9d..64bd938 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -16,7 +16,7 @@ You will need:
 
 ## Running Demo
 you can run saga-dubbo-demo as normal spring application
-1. init database: sql/schema-mysql.sql, and config database info by enviroment params   
+1. init database: sql/schema-mysql.sql, and config database info and zookeeper url by enviroment params   
    enviroment params example:  
  -Ddatabase.url=jdbc:mysql://127.0.0.1:3306/saga_dubbo  
  -Ddatabase.username=root  
@@ -24,5 +24,4 @@ you can run saga-dubbo-demo as normal spring application
  -Dzookeeper.url=localhost:2181  
  -Dserver.port=8071  
 
-2. config zookeeper url by enviroment param
-3. run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file
+2. run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/ServiceVO.java b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/ServiceVO.java
new file mode 100644
index 0000000..ff53b78
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/ServiceVO.java
@@ -0,0 +1,48 @@
+/*
+ * 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.demo.dubbo.pub;
+
+public class ServiceVO {
+
+    private String id;
+    private String service;
+    private String vstatus;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getService() {
+        return service;
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public String getVstatus() {
+        return vstatus;
+    }
+
+    public void setVstatus(String vstatus) {
+        this.vstatus = vstatus;
+    }
+}
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java
index c2c9eb3..ef9981a 100644
--- a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java
@@ -20,11 +20,17 @@ package org.apache.servicecomb.saga.demo.dubbo.servicea.web;
 import org.apache.servicecomb.saga.demo.dubbo.api.IServiceA;
 import org.apache.servicecomb.saga.demo.dubbo.pub.IInvokeCode;
 import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+import org.apache.servicecomb.saga.demo.dubbo.pub.ServiceVO;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.List;
+
 @RestController
 public class DubboDemoController {
 
@@ -99,10 +105,10 @@ public class DubboDemoController {
         String status_a = getServiceStatus("testa");
         String status_b = getServiceStatus("testb");
         String status_c = getServiceStatus("testc");
-        boolean checkResult = checkResult("init", status_a, "init", status_b, "init", status_c);
+        boolean checkResult = checkResult("init", status_a, "cancel", status_b, "init", status_c);
         return String.format(IInvokeCode.CExceptionWhenAbAc_description +
                 "</br>check result: %s" +
-                "</br>expected status: A:init, B:init, C:init" +
+                "</br>expected status: A:init, B:cancel, C:init" +
                 "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
     }
 
@@ -132,6 +138,12 @@ public class DubboDemoController {
                 "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
     }
 
+    @GetMapping("/serviceInfo/{serviceName}")
+    public List<ServiceVO> serviceInfo(@PathVariable String serviceName){
+      String tableName = "test"+serviceName.replace("service", "");
+        return this.jdbcTemplate.query("select * from " + tableName, new BeanPropertyRowMapper<>(ServiceVO.class));
+    }
+
     public void serviceInvoke(String invokeCode) throws InterruptedException {
         reset();
         try{

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

[incubator-servicecomb-saga] 10/12: SCB-555 Updated the log setting to info level

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1f79da35de7e207f786c0497d3fdc1a532da413d
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Sat May 26 16:13:16 2018 +0800

    SCB-555 Updated the log setting to info level
---
 saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml | 2 +-
 saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml | 2 +-
 saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml
index eb57a2d..cae04cb 100644
--- a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml
@@ -23,7 +23,7 @@
     </Console>
   </Appenders>
   <Loggers>
-    <AsyncRoot level="debug">
+    <AsyncRoot level="info">
       <AppenderRef ref="Console"/>
     </AsyncRoot>
   </Loggers>
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml
index eb57a2d..cae04cb 100644
--- a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml
@@ -23,7 +23,7 @@
     </Console>
   </Appenders>
   <Loggers>
-    <AsyncRoot level="debug">
+    <AsyncRoot level="info">
       <AppenderRef ref="Console"/>
     </AsyncRoot>
   </Loggers>
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml
index eb57a2d..cae04cb 100644
--- a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml
@@ -23,7 +23,7 @@
     </Console>
   </Appenders>
   <Loggers>
-    <AsyncRoot level="debug">
+    <AsyncRoot level="info">
       <AppenderRef ref="Console"/>
     </AsyncRoot>
   </Loggers>

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

[incubator-servicecomb-saga] 02/12: SCB-555 Add saga-dubbo-demo README

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 07fb16e9c9f99bf161265784456da069ef3f5b0c
Author: wuzunqian <wu...@msn.com>
AuthorDate: Sun May 6 01:26:16 2018 +0800

    SCB-555 Add saga-dubbo-demo README
---
 saga-demo/saga-dubbo-demo/README.md | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md
index 86ecbf6..1565b9d 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -16,13 +16,13 @@ You will need:
 
 ## Running Demo
 you can run saga-dubbo-demo as normal spring application
-1.init database: sql/schema-mysql.sql, and config database info by enviroment params
-enviroment params example:
--Ddatabase.url=jdbc:mysql://127.0.0.1:3306/saga_dubbo
--Ddatabase.username=root
--Ddatabase.password=***
--Dzookeeper.url=localhost:2181
--Dserver.port=8071
+1. init database: sql/schema-mysql.sql, and config database info by enviroment params   
+   enviroment params example:  
+ -Ddatabase.url=jdbc:mysql://127.0.0.1:3306/saga_dubbo  
+ -Ddatabase.username=root  
+ -Ddatabase.password=***  
+ -Dzookeeper.url=localhost:2181  
+ -Dserver.port=8071  
 
-2.config zookeeper url by enviroment param
-3.run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file
+2. config zookeeper url by enviroment param
+3. run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file

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

[incubator-servicecomb-saga] 08/12: docker plugin for mvn test

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8c56cf0c079c33f925d8635479e5686fc4cd3101
Author: wuzunqian <wu...@msn.com>
AuthorDate: Tue May 15 00:58:21 2018 +0800

    docker plugin for mvn test
---
 acceptance-tests/acceptance-dubbo-demo/pom.xml     | 279 +++++++++++++++++++++
 .../acceptance/dubbodemo/DubboDemoStepdefs.java    |   1 -
 .../src/main/resources/schema-mysql.sql            |   6 +-
 saga-demo/pom.xml                                  |   5 +
 .../saga-dubbo-demo/docker-compose.mysql.yaml      | 106 +++++++-
 saga-demo/saga-dubbo-demo/docker-compose.yaml      |  73 ++++++
 saga-demo/saga-dubbo-demo/pom.xml                  |  13 +-
 saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh       |   2 +-
 saga-demo/saga-dubbo-demo/service-api/pom.xml      |   5 -
 saga-demo/saga-dubbo-demo/servicea/pom.xml         |  44 ++++
 .../servicea/src/main/resources/application.yaml   |  31 ++-
 .../servicea/src/main/resources/jdbc.xml           |  44 +---
 .../servicea/src/main/resources/schema-mysql.sql   |  24 ++
 .../src/main/resources/schema-postgresql.sql       |  26 ++
 saga-demo/saga-dubbo-demo/serviceb/pom.xml         |  44 ++++
 .../serviceb/src/main/resources/application.yaml   |  25 +-
 .../serviceb/src/main/resources/jdbc.xml           |  43 +---
 .../serviceb/src/main/resources/schema-mysql.sql   |  24 ++
 .../src/main/resources/schema-postgresql.sql       |  26 ++
 saga-demo/saga-dubbo-demo/servicec/pom.xml         |  44 ++++
 .../servicec/src/main/resources/application.yaml   |  25 +-
 .../servicec/src/main/resources/jdbc.xml           |  43 +---
 .../servicec/src/main/resources/schema-mysql.sql   |  24 ++
 .../src/main/resources/schema-postgresql.sql       |  26 ++
 24 files changed, 849 insertions(+), 134 deletions(-)

diff --git a/acceptance-tests/acceptance-dubbo-demo/pom.xml b/acceptance-tests/acceptance-dubbo-demo/pom.xml
index 023a2d8..8dc7265 100644
--- a/acceptance-tests/acceptance-dubbo-demo/pom.xml
+++ b/acceptance-tests/acceptance-dubbo-demo/pom.xml
@@ -41,5 +41,284 @@
         </dependency>
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                        <configuration>
+                            <images>
+                                <image>
+                                    <name>docker.io/zookeeper</name>
+                                    <alias>zookeeper</alias>
+                                    <run>
+                                        <ports>
+                                            <port>zk.port:2181</port>
+                                        </ports>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>postgres</name>
+                                    <alias>postgres</alias>
+                                    <run>
+                                        <env>
+                                            <POSTGRES_DB>saga</POSTGRES_DB>
+                                            <POSTGRES_USER>saga</POSTGRES_USER>
+                                            <POSTGRES_PASSWORD>password</POSTGRES_PASSWORD>
+                                        </env>
+                                        <wait>
+                                            <log>database system is ready to accept connections</log>
+                                            <tcp>
+                                                <ports>
+                                                    <port>5432</port>
+                                                </ports>
+                                            </tcp>
+                                            <time>60000</time>
+                                        </wait>
+                                        <ports>
+                                            <port>postgres.port:5432</port>
+                                        </ports>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>alpha-server:${project.version}</name>
+                                    <alias>alpha</alias>
+                                    <run>
+                                        <env>
+                                            <JAVA_OPTS>
+                                                -Dspring.profiles.active=prd -Dspring.datasource.initialization-mode=always
+                                            </JAVA_OPTS>
+                                        </env>
+                                        <links>
+                                            <link>postgres:postgresql.servicecomb.io</link>
+                                        </links>
+                                        <wait>
+                                            <log>Started [a-zA-Z]+ in [0-9.]+ seconds</log>
+                                            <tcp>
+                                                <ports>
+                                                    <port>8080</port>
+                                                    <port>8090</port>
+                                                </ports>
+                                            </tcp>
+                                            <time>120000</time>
+                                        </wait>
+                                        <ports>
+                                            <port>alpha.port:8080</port>
+                                            <port>alpha.rest.port:8090</port>
+                                        </ports>
+                                        <dependsOn>
+                                            <container>postgres</container>
+                                        </dependsOn>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>servicea:${project.version}</name>
+                                    <alias>servicea</alias>
+                                    <run>
+                                        <env>
+                                            <JAVA_OPTS>
+                                                -Dspring.profiles.active=prd
+                                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                                -Dspring.datasource.username=saga
+                                                -Dspring.datasource.password=password
+                                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                                -Dserver.port=8071
+                                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                                -Dspring.datasource.initialization-mode=always
+                                            </JAVA_OPTS>
+                                        </env>
+                                        <wait>
+                                            <log>Started [a-zA-Z]+ in [0-9.]+ seconds</log>
+                                            <tcp>
+                                                <ports>
+                                                    <port>8071</port>
+                                                </ports>
+                                            </tcp>
+                                            <time>120000</time>
+                                        </wait>
+                                        <links>
+                                            <link>postgres:postgresql.servicecomb.io</link>
+                                            <link>alpha:alpha-server.servicecomb.io</link>
+                                            <link>zookeeper:zookeeper.servicecomb.io</link>
+                                        </links>
+                                        <ports>
+                                            <port>servicea.port:8071</port>
+                                        </ports>
+                                        <dependsOn>
+                                            <container>postgres</container>
+                                            <container>alpha</container>
+                                            <container>zookeeper</container>
+                                        </dependsOn>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>serviceb:${project.version}</name>
+                                    <alias>serviceb</alias>
+                                    <run>
+                                        <env>
+                                            <JAVA_OPTS>
+                                                -Dspring.profiles.active=prd
+                                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                                -Dspring.datasource.username=saga
+                                                -Dspring.datasource.password=password
+                                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                                -Dserver.port=8072
+                                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                                -Dspring.datasource.initialization-mode=always
+                                            </JAVA_OPTS>
+                                        </env>
+                                        <wait>
+                                            <log>Started [a-zA-Z]+ in [0-9.]+ seconds</log>
+                                            <tcp>
+                                                <ports>
+                                                    <port>8072</port>
+                                                </ports>
+                                            </tcp>
+                                            <time>120000</time>
+                                        </wait>
+                                        <links>
+                                            <link>postgres:postgresql.servicecomb.io</link>
+                                            <link>alpha:alpha-server.servicecomb.io</link>
+                                            <link>zookeeper:zookeeper.servicecomb.io</link>
+                                        </links>
+                                        <ports>
+                                            <port>serviceb.port:8072</port>
+                                        </ports>
+                                        <dependsOn>
+                                            <container>postgres</container>
+                                            <container>alpha</container>
+                                            <container>zookeeper</container>
+                                        </dependsOn>
+                                    </run>
+                                </image>
+                                <image>
+                                    <name>servicec:${project.version}</name>
+                                    <alias>servicec</alias>
+                                    <run>
+                                        <env>
+                                            <JAVA_OPTS>
+                                                -Dspring.profiles.active=prd
+                                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                                -Dspring.datasource.username=saga
+                                                -Dspring.datasource.password=password
+                                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                                -Dserver.port=8073
+                                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                                -Dspring.datasource.initialization-mode=always
+                                            </JAVA_OPTS>
+                                        </env>
+                                        <wait>
+                                            <log>Started [a-zA-Z]+ in [0-9.]+ seconds</log>
+                                            <tcp>
+                                                <ports>
+                                                    <port>8073</port>
+                                                </ports>
+                                            </tcp>
+                                            <time>120000</time>
+                                        </wait>
+                                        <links>
+                                            <link>postgres:postgresql.servicecomb.io</link>
+                                            <link>alpha:alpha-server.servicecomb.io</link>
+                                            <link>zookeeper:zookeeper.servicecomb.io</link>
+                                        </links>
+                                        <ports>
+                                            <port>servicec.port:8073</port>
+                                        </ports>
+                                        <dependsOn>
+                                            <container>postgres</container>
+                                            <container>alpha</container>
+                                            <container>zookeeper</container>
+                                        </dependsOn>
+                                    </run>
+                                </image>
+                            </images>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <id>start</id>
+                                <phase>pre-integration-test</phase>
+                                <goals>
+                                    <goal>start</goal>
+                                </goals>
+                            </execution>
+                            <execution>
+                                <id>stop</id>
+                                <phase>post-integration-test</phase>
+                                <goals>
+                                    <goal>stop</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.gmaven</groupId>
+                        <artifactId>gmaven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>add-default-properties</id>
+                                <phase>initialize</phase>
+                                <goals>
+                                    <goal>execute</goal>
+                                </goals>
+                                <configuration>
+                                    <source>
+                                        project.properties.setProperty('docker.hostname', 'localhost')
+                                        log.info("Docker hostname is " + project.properties['docker.hostname'])
+                                    </source>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <version>${maven.failsafe.version}</version>
+                        <configuration>
+                            <systemPropertyVariables>
+                                <alpha.cluster.address>
+                                    http://${docker.hostname}:${alpha.port}
+                                </alpha.cluster.address>
+                                <alpha.rest.address>
+                                    http://${docker.hostname}:${alpha.rest.port}
+                                </alpha.rest.address>
+                                <servicea.address>
+                                    http://${docker.hostname}:${servicea.port}
+                                </servicea.address>
+                                <serviceb.address>
+                                    http://${docker.hostname}:${serviceb.port}
+                                </serviceb.address>
+                                <servicec.address>
+                                    http://${docker.hostname}:${servicec.port}
+                                </servicec.address>
+                                <spring.datasource.url>
+                                    jdbc:postgresql://${docker.hostname}:${postgres.port}/saga?useSSL=false
+                                </spring.datasource.url>
+                                <info.service.uri>
+                                    ${info.service.uri}
+                                </info.service.uri>
+                            </systemPropertyVariables>
+                            <argLine>${jacoco.failsafe.argLine}</argLine>
+                        </configuration>
+                        <executions>
+                            <execution>
+                                <goals>
+                                    <goal>integration-test</goal>
+                                    <goal>verify</goal>
+                                </goals>
+                            </execution>
+                        </executions>
+                    </plugin>
+                    <plugin>
+                        <groupId>com.ethlo.persistence.tools</groupId>
+                        <artifactId>eclipselink-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 
 </project>
\ No newline at end of file
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
index 80e503e..9b07486 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
@@ -80,7 +80,6 @@ public class DubboDemoStepdefs implements En {
       Consumer<Map<String, Object>[]> sortAndColumnStrippingConsumer = dataMaps -> {
         //blur match: service for sagaEndedEvent may be unable to que
         for(Map<String, Object> dataMap : dataMaps){
-          LOG.info(dataMap.toString());
           if(dataMap.values().contains("SagaEndedEvent")){
             for(String key : dataMap.keySet()){
               if("SagaEndedEvent".equals(dataMap.get(key))){
diff --git a/alpha/alpha-server/src/main/resources/schema-mysql.sql b/alpha/alpha-server/src/main/resources/schema-mysql.sql
index e2e5d81..ecb934e 100644
--- a/alpha/alpha-server/src/main/resources/schema-mysql.sql
+++ b/alpha/alpha-server/src/main/resources/schema-mysql.sql
@@ -27,11 +27,12 @@ CREATE TABLE IF NOT EXISTS TxEvent (
   compensationMethod varchar(256) NOT NULL,
   expiryTime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   payloads varbinary(10240),
+  retries int(11) NOT NULL DEFAULT '0',
+  retryMethod varchar(256) DEFAULT NULL,
   PRIMARY KEY (surrogateId),
   INDEX saga_events_index (surrogateId, globalTxId, localTxId, type, expiryTime)
 ) DEFAULT CHARSET=utf8;
 
-
 CREATE TABLE IF NOT EXISTS Command (
   surrogateId bigint NOT NULL AUTO_INCREMENT,
   eventId bigint NOT NULL UNIQUE,
@@ -41,8 +42,6 @@ CREATE TABLE IF NOT EXISTS Command (
   localTxId varchar(36) NOT NULL,
   parentTxId varchar(36) DEFAULT NULL,
   compensationMethod varchar(256) NOT NULL,
-  retryMethod varchar(256) NOT NULL,
-  retries int NOT NULL DEFAULT 0,
   payloads varbinary(10240),
   status varchar(12),
   lastModified datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -51,7 +50,6 @@ CREATE TABLE IF NOT EXISTS Command (
   INDEX saga_commands_index (surrogateId, eventId, globalTxId, localTxId, status)
 ) DEFAULT CHARSET=utf8;
 
-
 CREATE TABLE IF NOT EXISTS TxTimeout (
   surrogateId bigint NOT NULL AUTO_INCREMENT,
   eventId bigint NOT NULL UNIQUE,
diff --git a/saga-demo/pom.xml b/saga-demo/pom.xml
index 9ee16f0..0c77b00 100644
--- a/saga-demo/pom.xml
+++ b/saga-demo/pom.xml
@@ -69,6 +69,11 @@
       <artifactId>spring-boot-starter-test</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.postgresql</groupId>
+      <artifactId>postgresql</artifactId>
+      <scope>runtime</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml b/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml
index 43f3b5e..6e0fcb7 100644
--- a/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml
+++ b/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml
@@ -15,25 +15,113 @@
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
 
+##
+#you need to add mysql drive to alpha pom.xml and saga-dubbo-demo pom.xml first
+##
 version: '2.1'
 
 services:
+
+  zookeeper:
+    image: "docker.io/zookeeper"
+    hostname: zookeeper
+
   database:
-    image: "mysql/mysql-server:5.7"
-    hostname: mysql
+      image: "mysql/mysql-server:5.7"
+      hostname: mysql
+      environment:
+        - MYSQL_ROOT_PASSWORD=password
+        - MYSQL_DATABASE=saga
+        - MYSQL_USER=saga
+        - MYSQL_PASSWORD=password
+      healthcheck:
+          test: ["CMD-SHELL", "nc -z localhost 3306 &> /dev/null; echo $$?"]
+          interval: 30s
+          timeout: 10s
+          retries: 5
+
+  alpha:
+    image: "alpha-server:${TAG}"
+    hostname: alpha-server
+    ports:
+      - "8081:8080"
+      - "8091:8090"
+    links:
+      - "database:mysql.servicecomb.io"
     environment:
-      - MYSQL_ROOT_PASSWORD=password
-      - MYSQL_DATABASE=saga
-      - MYSQL_USER=saga
-      - MYSQL_PASSWORD=password
+      - JAVA_OPTS=-Dspring.profiles.active=mysql
     healthcheck:
-        test: ["CMD-SHELL", "nc -z localhost 3306 &> /dev/null; echo $$?"]
+        test: ["CMD-SHELL", "nc -z localhost 8080 &> /dev/null; echo $$?"]
         interval: 30s
         timeout: 10s
         retries: 5
+    depends_on:
+      database:
+        condition: service_healthy
 
-  alpha:
+  servicea:
+    image: "servicea:${TAG}"
+    hostname: servicea
     links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
       - "database:mysql.servicecomb.io"
     environment:
-      - JAVA_OPTS=-Dspring.profiles.active=mysql
+      - JAVA_OPTS=  -Dspring.profiles.active=mysql
+                                -Dspring.datasource.url=jdbc:mysql://mysql.servicecomb.io:3306/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8071
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8071:8071"
+    depends_on:
+      alpha:
+        condition: service_healthy
+
+  serviceb:
+    image: "serviceb:${TAG}"
+    hostname: serviceb
+    links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
+      - "database:mysql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=  -Dspring.profiles.active=mysql
+                                -Dspring.datasource.url=jdbc:mysql://mysql.servicecomb.io:3306/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8072
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8072:8072"
+    depends_on:
+      alpha:
+        condition: service_healthy
+
+  servicec:
+    image: "servicec:${TAG}"
+    hostname: servicec
+    links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
+      - "database:mysql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=  -Dspring.profiles.active=mysql
+                                -Dspring.datasource.url=jdbc:mysql://mysql.servicecomb.io:3306/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8073
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8073:8073"
+    depends_on:
+      alpha:
+        condition: service_healthy
+
diff --git a/saga-demo/saga-dubbo-demo/docker-compose.yaml b/saga-demo/saga-dubbo-demo/docker-compose.yaml
index 7c3b8dd..b1e295c 100644
--- a/saga-demo/saga-dubbo-demo/docker-compose.yaml
+++ b/saga-demo/saga-dubbo-demo/docker-compose.yaml
@@ -18,6 +18,11 @@
 version: '2.1'
 
 services:
+
+  zookeeper:
+    image: "docker.io/zookeeper"
+    hostname: zookeeper
+
   database:
     image: "postgres"
     hostname: postgres
@@ -25,6 +30,8 @@ services:
       - POSTGRES_DB=saga
       - POSTGRES_USER=saga
       - POSTGRES_PASSWORD=password
+    ports:
+      - "5432:5432"
     healthcheck:
         test: ["CMD-SHELL", "nc -z localhost 5432 &> /dev/null; echo $$?"]
         interval: 30s
@@ -49,3 +56,69 @@ services:
     depends_on:
       database:
         condition: service_healthy
+
+  servicea:
+    image: "servicea:${TAG}"
+    hostname: servicea
+    links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
+      - "database:postgresql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=  -Dspring.profiles.active=prd
+                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8071
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8071:8071"
+    depends_on:
+      alpha:
+        condition: service_healthy
+
+  serviceb:
+    image: "serviceb:${TAG}"
+    hostname: serviceb
+    links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
+      - "database:postgresql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=  -Dspring.profiles.active=prd
+                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8072
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8072:8072"
+    depends_on:
+      alpha:
+        condition: service_healthy
+
+  servicec:
+    image: "servicec:${TAG}"
+    hostname: servicec
+    links:
+      - "zookeeper:zookeeper.servicecomb.io"
+      - "alpha:alpha-server.servicecomb.io"
+      - "database:postgresql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=  -Dspring.profiles.active=prd
+                                -Dspring.datasource.url=jdbc:postgresql://postgresql.servicecomb.io:5432/saga
+                                -Dspring.datasource.username=saga
+                                -Dspring.datasource.password=password
+                                -Dzookeeper.url=zookeeper.servicecomb.io:2181
+                                -Dserver.port=8073
+                                -Dalpha.cluster.address=alpha-server.servicecomb.io:8080
+                                -Dspring.datasource.initialization-mode=always
+    ports:
+      - "8073:8073"
+    depends_on:
+      alpha:
+        condition: service_healthy
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/pom.xml b/saga-demo/saga-dubbo-demo/pom.xml
index 634cd69..a7d568b 100644
--- a/saga-demo/saga-dubbo-demo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/pom.xml
@@ -81,17 +81,9 @@
         </dependency>
         <dependency>
             <groupId>org.apache.servicecomb.saga</groupId>
-            <artifactId>omega-spring-starter</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicecomb.saga</groupId>
             <artifactId>omega-transport-resttemplate</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
-        </dependency>
-        <dependency>
             <groupId>com.github.sgroschupf</groupId>
             <artifactId>zkclient</artifactId>
             <version>0.1</version>
@@ -107,10 +99,9 @@
             <artifactId>commons-dbcp2</artifactId>
             <version>2.1.1</version>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>mysql</groupId>
             <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.37</version>
-        </dependency>
+        </dependency>-->
     </dependencies>
 </project>
diff --git a/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
index 48df117..6a9a926 100755
--- a/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
+++ b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
@@ -26,7 +26,7 @@ case $1 in
   up-mysql)
     fetch_version
     echo "Starting ${service}:${version}"
-    TAG=$version docker-compose -f docker-compose.yaml -f docker-compose.mysql.yaml up
+    TAG=$version docker-compose -f docker-compose.mysql.yaml up
     exit $?
   ;;
   
diff --git a/saga-demo/saga-dubbo-demo/service-api/pom.xml b/saga-demo/saga-dubbo-demo/service-api/pom.xml
index 1347a47..36b0c58 100644
--- a/saga-demo/saga-dubbo-demo/service-api/pom.xml
+++ b/saga-demo/saga-dubbo-demo/service-api/pom.xml
@@ -24,12 +24,7 @@
         <dependency>
             <groupId>org.apache.servicecomb.saga.demo</groupId>
             <artifactId>service-pub</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.servicecomb.saga.demo</groupId>
-            <artifactId>service-pub</artifactId>
             <version>0.2.0-SNAPSHOT</version>
-            <scope>compile</scope>
         </dependency>
     </dependencies>
 
diff --git a/saga-demo/saga-dubbo-demo/servicea/pom.xml b/saga-demo/saga-dubbo-demo/servicea/pom.xml
index 1360034..33102df 100644
--- a/saga-demo/saga-dubbo-demo/servicea/pom.xml
+++ b/saga-demo/saga-dubbo-demo/servicea/pom.xml
@@ -41,4 +41,48 @@
 
     <artifactId>servicea</artifactId>
 
+    <build>
+        <plugins>
+            <!-- mixin plugin configurations declared in another pom,
+            just like importing dependencies managed in another pom -->
+            <plugin>
+                <groupId>com.github.odavid.maven.plugins</groupId>
+                <artifactId>mixin-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.commonjava.maven.plugins</groupId>
+                        <artifactId>directory-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>demo</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml
index 3880847..98d0b78 100644
--- a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml
@@ -17,7 +17,36 @@
 spring:
   application:
     name: servicea
+  profiles:
+    active: prd
+
 alpha:
   cluster:
-    address: localhost:8080
+    address: alpha-server.servicecomb.io:8080
+
+---
+spring:
+  profiles: prd
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:postgresql://postgresql.servicecomb.io:5432/saga?useSSL=false
+    platform: postgresql
+
+---
+spring:
+  profiles: mysql
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:mysql://mysql.servicecomb.io:3306/saga?useSSL=false
+    platform: mysql
+    continue-on-error: true
+  jpa:
+    properties:
+      eclipselink:
+        ddl-generation: none
+
+
+
 
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml
index 001ee81..219e96a 100644
--- a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml
@@ -16,40 +16,16 @@
   ~ limitations under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:tx="http://www.springframework.org/schema/tx"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans    
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
-           http://www.springframework.org/schema/context    
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
-           http://www.springframework.org/schema/aop    
-           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
-           http://www.springframework.org/schema/tx 
-           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
-		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
-		<!--jdbc:mysql://127.0.0.1:3306/saga_dubbo-->
-		<property name="url" value="${database.url}" />
-		<property name="username" value="${database.username}" />
-		<property name="password" value="${database.password}" />
-		<property name="maxTotal" value="50" />
-		<property name="initialSize" value="20" />
-		<property name="maxWaitMillis" value="60000" />
-		<property name="minIdle" value="6" />
-		<property name="logAbandoned" value="true" />
-		<property name="removeAbandonedOnMaintenance" value="true" />
-		<property name="removeAbandonedOnBorrow" value="true" />
-		<property name="removeAbandonedTimeout" value="1800" />
-
-		<property name="testWhileIdle" value="true" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="validationQuery" value="select 'x' " />
-		<property name="validationQueryTimeout" value="1" />
-		<property name="timeBetweenEvictionRunsMillis" value="30000" />
-		<property name="numTestsPerEvictionRun" value="20" />
-	</bean>
+	   xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	   xmlns:tx="http://www.springframework.org/schema/tx"
+	   xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-3.1.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
 
 	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
 		<property name="dataSource" ref="dataSource" />
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql
new file mode 100644
index 0000000..91fc88a
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-mysql.sql
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+CREATE TABLE `testa` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+INSERT INTO `testa` (`id`, `service`, `vstatus`) VALUES ('1','servicea','init');
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql
new file mode 100644
index 0000000..21c05cd
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/schema-postgresql.sql
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS testa (
+  id BIGSERIAL PRIMARY KEY,
+  service varchar(128) NOT NULL,
+  vstatus varchar(36) NOT NULL
+);
+
+CREATE INDEX IF NOT EXISTS testa_index ON testa (id, service);
+
+INSERT INTO testa (id, service, vstatus) VALUES ('1','servicea','init');
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/serviceb/pom.xml b/saga-demo/saga-dubbo-demo/serviceb/pom.xml
index bbfceb6..2471269 100644
--- a/saga-demo/saga-dubbo-demo/serviceb/pom.xml
+++ b/saga-demo/saga-dubbo-demo/serviceb/pom.xml
@@ -37,4 +37,48 @@
 
     <artifactId>serviceb</artifactId>
 
+    <build>
+        <plugins>
+            <!-- mixin plugin configurations declared in another pom,
+            just like importing dependencies managed in another pom -->
+            <plugin>
+                <groupId>com.github.odavid.maven.plugins</groupId>
+                <artifactId>mixin-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.commonjava.maven.plugins</groupId>
+                        <artifactId>directory-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>demo</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml
index f78027a..be1536a 100644
--- a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml
@@ -19,4 +19,27 @@ spring:
     name: serviceb
 alpha:
   cluster:
-    address: localhost:8080
+    address: alpha-server.servicecomb.io:8080
+
+---
+spring:
+  profiles: prd
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:postgresql://postgresql.servicecomb.io:5432/saga?useSSL=false
+    platform: postgresql
+
+---
+spring:
+  profiles: mysql
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:mysql://mysql.servicecomb.io:3306/saga?useSSL=false
+    platform: mysql
+    continue-on-error: true
+  jpa:
+    properties:
+      eclipselink:
+        ddl-generation: none
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml
index 3bdafa1..219e96a 100644
--- a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml
@@ -16,39 +16,16 @@
   ~ limitations under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:tx="http://www.springframework.org/schema/tx"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans    
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
-           http://www.springframework.org/schema/context    
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
-           http://www.springframework.org/schema/aop    
-           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
-           http://www.springframework.org/schema/tx 
-           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
-		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
-		<property name="url" value="${database.url}" />
-		<property name="username" value="${database.username}" />
-		<property name="password" value="${database.password}" />
-		<property name="maxTotal" value="50" />
-		<property name="initialSize" value="20" />
-		<property name="maxWaitMillis" value="60000" />
-		<property name="minIdle" value="6" />
-		<property name="logAbandoned" value="true" />
-		<property name="removeAbandonedOnMaintenance" value="true" />
-		<property name="removeAbandonedOnBorrow" value="true" />
-		<property name="removeAbandonedTimeout" value="1800" />
-
-		<property name="testWhileIdle" value="true" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="validationQuery" value="select 'x' " />
-		<property name="validationQueryTimeout" value="1" />
-		<property name="timeBetweenEvictionRunsMillis" value="30000" />
-		<property name="numTestsPerEvictionRun" value="20" />
-	</bean>
+	   xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	   xmlns:tx="http://www.springframework.org/schema/tx"
+	   xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-3.1.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
 
 	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
 		<property name="dataSource" ref="dataSource" />
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-mysql.sql b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-mysql.sql
new file mode 100644
index 0000000..2bc2a0c
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-mysql.sql
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+CREATE TABLE `testb` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+INSERT INTO `testb` (`id`, `service`, `vstatus`) VALUES ('2','serviceb','init');
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-postgresql.sql b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-postgresql.sql
new file mode 100644
index 0000000..a50781b
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/schema-postgresql.sql
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS testb (
+  id BIGSERIAL PRIMARY KEY,
+  service varchar(128) NOT NULL,
+  vstatus varchar(36) NOT NULL
+);
+
+CREATE INDEX IF NOT EXISTS testb_index ON testb (id, service);
+
+INSERT INTO testb (id, service, vstatus) VALUES ('1','serviceb','init');
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicec/pom.xml b/saga-demo/saga-dubbo-demo/servicec/pom.xml
index 79cdd4d..f15fe2a 100644
--- a/saga-demo/saga-dubbo-demo/servicec/pom.xml
+++ b/saga-demo/saga-dubbo-demo/servicec/pom.xml
@@ -37,4 +37,48 @@
 
     <artifactId>servicec</artifactId>
 
+    <build>
+        <plugins>
+            <!-- mixin plugin configurations declared in another pom,
+            just like importing dependencies managed in another pom -->
+            <plugin>
+                <groupId>com.github.odavid.maven.plugins</groupId>
+                <artifactId>mixin-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>docker</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>io.fabric8</groupId>
+                        <artifactId>docker-maven-plugin</artifactId>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.commonjava.maven.plugins</groupId>
+                        <artifactId>directory-maven-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>demo</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
 </project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml
index 0535557..7b282f5 100644
--- a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml
@@ -19,4 +19,27 @@ spring:
     name: servicec
 alpha:
   cluster:
-    address: localhost:8080
+    address: alpha-server.servicecomb.io:8080
+
+---
+spring:
+  profiles: prd
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:postgresql://postgresql.servicecomb.io:5432/saga?useSSL=false
+    platform: postgresql
+
+---
+spring:
+  profiles: mysql
+  datasource:
+    username: saga
+    password: password
+    url: jdbc:mysql://mysql.servicecomb.io:3306/saga?useSSL=false
+    platform: mysql
+    continue-on-error: true
+  jpa:
+    properties:
+      eclipselink:
+        ddl-generation: none
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml
index 3bdafa1..219e96a 100644
--- a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml
@@ -16,39 +16,16 @@
   ~ limitations under the License.
   -->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:tx="http://www.springframework.org/schema/tx"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans    
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
-           http://www.springframework.org/schema/context    
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
-           http://www.springframework.org/schema/aop    
-           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
-           http://www.springframework.org/schema/tx 
-           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
-
-	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
-		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
-		<property name="url" value="${database.url}" />
-		<property name="username" value="${database.username}" />
-		<property name="password" value="${database.password}" />
-		<property name="maxTotal" value="50" />
-		<property name="initialSize" value="20" />
-		<property name="maxWaitMillis" value="60000" />
-		<property name="minIdle" value="6" />
-		<property name="logAbandoned" value="true" />
-		<property name="removeAbandonedOnMaintenance" value="true" />
-		<property name="removeAbandonedOnBorrow" value="true" />
-		<property name="removeAbandonedTimeout" value="1800" />
-
-		<property name="testWhileIdle" value="true" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-		<property name="validationQuery" value="select 'x' " />
-		<property name="validationQueryTimeout" value="1" />
-		<property name="timeBetweenEvictionRunsMillis" value="30000" />
-		<property name="numTestsPerEvictionRun" value="20" />
-	</bean>
+	   xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	   xmlns:tx="http://www.springframework.org/schema/tx"
+	   xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context-3.1.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
 
 	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
 		<property name="dataSource" ref="dataSource" />
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-mysql.sql b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-mysql.sql
new file mode 100644
index 0000000..8a32eae
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-mysql.sql
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+CREATE TABLE `testc` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+INSERT INTO `testc` (`id`, `service`, `vstatus`) VALUES ('3','servicec','init');
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-postgresql.sql b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-postgresql.sql
new file mode 100644
index 0000000..58f27dc
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/schema-postgresql.sql
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+CREATE TABLE IF NOT EXISTS testc (
+  id BIGSERIAL PRIMARY KEY,
+  service varchar(128) NOT NULL,
+  vstatus varchar(36) NOT NULL
+);
+
+CREATE INDEX IF NOT EXISTS testc_index ON testc (id, service);
+
+INSERT INTO testc (id, service, vstatus) VALUES ('1','servicec','init');
\ No newline at end of file

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

[incubator-servicecomb-saga] 09/12: modify readme

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f45d559e92318825efa8e741d632ab5d2af8b9fd
Author: wuzunqian <wu...@msn.com>
AuthorDate: Tue May 15 01:01:17 2018 +0800

    modify readme
---
 saga-demo/saga-dubbo-demo/README.md | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md
index 64bd938..098fd85 100644
--- a/saga-demo/saga-dubbo-demo/README.md
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -15,13 +15,6 @@ You will need:
 [alpha_server]: https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha
 
 ## Running Demo
-you can run saga-dubbo-demo as normal spring application
-1. init database: sql/schema-mysql.sql, and config database info and zookeeper url by enviroment params   
-   enviroment params example:  
- -Ddatabase.url=jdbc:mysql://127.0.0.1:3306/saga_dubbo  
- -Ddatabase.username=root  
- -Ddatabase.password=***  
- -Dzookeeper.url=localhost:2181  
- -Dserver.port=8071  
+1.mvn clean install -DskipTests -Pdocker
+2. ./saga-dubbo-demo.sh up
 
-2. run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file

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

[incubator-servicecomb-saga] 07/12: revert first

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0a2b578cb4b0bf83c05780b4e808f42d0342ae13
Author: wuzunqian <wu...@msn.com>
AuthorDate: Sun May 13 15:19:34 2018 +0800

    revert first
---
 alpha/alpha-server/src/main/resources/schema-mysql.sql | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/alpha/alpha-server/src/main/resources/schema-mysql.sql b/alpha/alpha-server/src/main/resources/schema-mysql.sql
index ecb934e..e2e5d81 100644
--- a/alpha/alpha-server/src/main/resources/schema-mysql.sql
+++ b/alpha/alpha-server/src/main/resources/schema-mysql.sql
@@ -27,12 +27,11 @@ CREATE TABLE IF NOT EXISTS TxEvent (
   compensationMethod varchar(256) NOT NULL,
   expiryTime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
   payloads varbinary(10240),
-  retries int(11) NOT NULL DEFAULT '0',
-  retryMethod varchar(256) DEFAULT NULL,
   PRIMARY KEY (surrogateId),
   INDEX saga_events_index (surrogateId, globalTxId, localTxId, type, expiryTime)
 ) DEFAULT CHARSET=utf8;
 
+
 CREATE TABLE IF NOT EXISTS Command (
   surrogateId bigint NOT NULL AUTO_INCREMENT,
   eventId bigint NOT NULL UNIQUE,
@@ -42,6 +41,8 @@ CREATE TABLE IF NOT EXISTS Command (
   localTxId varchar(36) NOT NULL,
   parentTxId varchar(36) DEFAULT NULL,
   compensationMethod varchar(256) NOT NULL,
+  retryMethod varchar(256) NOT NULL,
+  retries int NOT NULL DEFAULT 0,
   payloads varbinary(10240),
   status varchar(12),
   lastModified datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -50,6 +51,7 @@ CREATE TABLE IF NOT EXISTS Command (
   INDEX saga_commands_index (surrogateId, eventId, globalTxId, localTxId, status)
 ) DEFAULT CHARSET=utf8;
 
+
 CREATE TABLE IF NOT EXISTS TxTimeout (
   surrogateId bigint NOT NULL AUTO_INCREMENT,
   eventId bigint NOT NULL UNIQUE,

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

[incubator-servicecomb-saga] 05/12: add module saga-dubbo-demo

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 3273eaf34e38409ca22f139ff95f8f43bede15a8
Author: wuzunqian <wu...@msn.com>
AuthorDate: Thu May 10 16:51:19 2018 +0800

    add module saga-dubbo-demo
---
 saga-demo/pom.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/saga-demo/pom.xml b/saga-demo/pom.xml
index 10f27db..9ee16f0 100644
--- a/saga-demo/pom.xml
+++ b/saga-demo/pom.xml
@@ -31,6 +31,7 @@
   <packaging>pom</packaging>
   <modules>
     <module>booking</module>
+    <module>saga-dubbo-demo</module>
   </modules>
 
   <dependencyManagement>

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

[incubator-servicecomb-saga] 04/12: fix result events unorder

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f6d4cd9eb71af30d52387e7800dd240be2c0ec9c
Author: wuzunqian <wu...@msn.com>
AuthorDate: Thu May 10 16:50:23 2018 +0800

    fix result events unorder
---
 .../acceptance/dubbodemo/DubboDemoStepdefs.java    | 25 +++++++++++++---------
 .../resources/AExceptionWhenAb_scenario.feature    |  2 +-
 .../test/resources/AbAc_success_scenario.feature   |  2 +-
 .../test/resources/AbBc_success_scenario.feature   |  2 +-
 .../src/test/resources/Ab_success_scenario.feature |  2 +-
 .../resources/BExceptionWhenAb_scenario.feature    |  2 +-
 .../resources/CExceptionWhenAbAc_scenario.feature  |  2 +-
 .../resources/CExceptionWhenAbBc_scenario.feature  |  2 +-
 8 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
index af6b7d1..80e503e 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/java/org/apache/servicecomb/saga/acceptance/dubbodemo/DubboDemoStepdefs.java
@@ -77,16 +77,21 @@ public class DubboDemoStepdefs implements En {
     });
 
     Then("^Alpha records the following events$", (DataTable dataTable) -> {
-      Consumer<Map<String, Object>[]> sortAndColumnStrippingConsumer = dataMap -> {
-        //sort first
-        Arrays.sort(dataMap, (o1, o2) -> {
-          Integer id1 = (Integer)o1.get("surrogateId");
-          Integer id2 = (Integer)o2.get("surrogateId");
-          if(id1 == null || id2 == null) return 0;
-          return id1.compareTo(id2);
-        });
+      Consumer<Map<String, Object>[]> sortAndColumnStrippingConsumer = dataMaps -> {
+        //blur match: service for sagaEndedEvent may be unable to que
+        for(Map<String, Object> dataMap : dataMaps){
+          LOG.info(dataMap.toString());
+          if(dataMap.values().contains("SagaEndedEvent")){
+            for(String key : dataMap.keySet()){
+              if("SagaEndedEvent".equals(dataMap.get(key))){
+                dataMap.put("serviceName", "*");
+                break;
+              }
+            }
+          }
+        }
         //strip columns
-        for (Map<String, Object> map : dataMap)
+        for (Map<String, Object> map : dataMaps)
           map.keySet().retainAll(dataTable.topCells());
       };
 
@@ -131,7 +136,7 @@ public class DubboDemoStepdefs implements En {
     }
 
     LOG.info("Retrieved data {} from service", actualMaps);
-    dataTable.diff(DataTable.create(actualMaps));
+    dataTable.unorderedDiff(DataTable.create(actualMaps));
   }
 
   @SuppressWarnings("unchecked")
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature
index 2be4378..5622006 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AExceptionWhenAb_scenario.feature
@@ -30,7 +30,7 @@ Feature: Alpha records transaction events
       | serviceb   | TxEndedEvent   |
       | servicea   | TxAbortedEvent     |
       | serviceb | TxCompensatedEvent   |
-      | serviceb | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature
index 9ba638e..bb8ed91 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbAc_success_scenario.feature
@@ -32,7 +32,7 @@ Feature: Alpha records transaction events
       | servicec | TxStartedEvent   |
       | servicec | TxEndedEvent   |
       | servicea | TxEndedEvent   |
-      | servicea | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature
index 1af54fc..4d3739e 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/AbBc_success_scenario.feature
@@ -32,7 +32,7 @@ Feature: Alpha records transaction events
       | servicec | TxEndedEvent   |
       | serviceb | TxEndedEvent   |
       | servicea | TxEndedEvent   |
-      | servicea | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature
index 3313bb4..b3b1c6d 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/Ab_success_scenario.feature
@@ -29,7 +29,7 @@ Feature: Alpha records transaction events
       | serviceb    | TxStartedEvent     |
       | serviceb   | TxEndedEvent   |
       | servicea   | TxEndedEvent     |
-      | servicea | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature
index 65d1d8f..d0e295e 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/BExceptionWhenAb_scenario.feature
@@ -29,7 +29,7 @@ Feature: Alpha records transaction events
       | serviceb    | TxStartedEvent     |
       | serviceb   | TxAbortedEvent   |
       | servicea   | TxAbortedEvent     |
-      | servicea | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature
index 689b4f1..9c3bdc9 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbAc_scenario.feature
@@ -33,7 +33,7 @@ Feature: Alpha records transaction events
       | servicec | TxAbortedEvent   |
       | servicea | TxAbortedEvent   |
       | serviceb | TxCompensatedEvent   |
-      | serviceb | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |
diff --git a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature
index 54fa1f9..065a0cf 100644
--- a/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature
+++ b/acceptance-tests/acceptance-dubbo-demo/src/test/resources/CExceptionWhenAbBc_scenario.feature
@@ -32,7 +32,7 @@ Feature: Alpha records transaction events
       | servicec | TxAbortedEvent   |
       | serviceb | TxAbortedEvent   |
       | servicea | TxAbortedEvent   |
-      | servicea | SagaEndedEvent   |
+      | * | SagaEndedEvent   |
 
     And servicea success update status
       | service | vstatus |

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

[incubator-servicecomb-saga] 11/12: SCB-555 Fixed the test error with spring boot 2

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ca56d9512837db4dd4c5bfc031a0bee30062956c
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Sat May 26 16:14:33 2018 +0800

    SCB-555 Fixed the test error with spring boot 2
---
 acceptance-tests/acceptance-dubbo-demo/pom.xml |  8 +++++++-
 saga-demo/saga-dubbo-demo/pom.xml              | 16 ++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/acceptance-tests/acceptance-dubbo-demo/pom.xml b/acceptance-tests/acceptance-dubbo-demo/pom.xml
index 8dc7265..85500d4 100644
--- a/acceptance-tests/acceptance-dubbo-demo/pom.xml
+++ b/acceptance-tests/acceptance-dubbo-demo/pom.xml
@@ -318,7 +318,13 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>spring-boot-2</id>
+            <properties>
+                <info.service.uri>/actuator/info</info.service.uri>
+            </properties>
+        </profile>
     </profiles>
 
 
-</project>
\ No newline at end of file
+</project>
diff --git a/saga-demo/saga-dubbo-demo/pom.xml b/saga-demo/saga-dubbo-demo/pom.xml
index a7d568b..af8cc4c 100644
--- a/saga-demo/saga-dubbo-demo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/pom.xml
@@ -104,4 +104,20 @@
             <artifactId>mysql-connector-java</artifactId>
         </dependency>-->
     </dependencies>
+    <profiles>
+        <profile>
+            <id>spring-boot-2</id>
+            <properties>
+                <spring.boot.version>${spring.boot2.version}</spring.boot.version>
+            </properties>
+            <!-- Need to add the dependency of log4j jar to avoid no class found error -->
+            <dependencies>
+                <dependency>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                    <version>1.2.17</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
 </project>

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

[incubator-servicecomb-saga] 12/12: SCB-555 Clean up the dock-componse file

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 94606f723a9ed818e837247e9af1b72720860b9e
Author: Willem Jiang <ji...@huawei.com>
AuthorDate: Sat May 26 16:21:12 2018 +0800

    SCB-555 Clean up the dock-componse file
---
 saga-demo/saga-dubbo-demo/docker-compose.yaml | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/saga-demo/saga-dubbo-demo/docker-compose.yaml b/saga-demo/saga-dubbo-demo/docker-compose.yaml
index b1e295c..3510f86 100644
--- a/saga-demo/saga-dubbo-demo/docker-compose.yaml
+++ b/saga-demo/saga-dubbo-demo/docker-compose.yaml
@@ -22,6 +22,8 @@ services:
   zookeeper:
     image: "docker.io/zookeeper"
     hostname: zookeeper
+    ports:
+      - "2181:2181"
 
   database:
     image: "postgres"
@@ -42,8 +44,8 @@ services:
     image: "alpha-server:${TAG}"
     hostname: alpha-server
     ports:
-      - "8081:8080"
-      - "8091:8090"
+      - "8080:8080"
+      - "8090:8090"
     links:
       - "database:postgresql.servicecomb.io"
     environment:
@@ -121,4 +123,4 @@ services:
       - "8073:8073"
     depends_on:
       alpha:
-        condition: service_healthy
\ No newline at end of file
+        condition: service_healthy

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

[incubator-servicecomb-saga] 01/12: SCB-555 Add saga-dubbo-demo It also shows verify the error of SCB-547 click 7.[A.run->B.run, B.run->C.run(x), C.run exception], and org.apache.servicecomb.saga.alpha.core.EventScanner.pollEvents scheduler will stop running. TODO: add acceptance test (cucumber)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f012bf72da91528a1e9032e558f2f65cff50a0c1
Author: wuzunqian <wu...@msn.com>
AuthorDate: Sun May 6 01:09:23 2018 +0800

    SCB-555 Add saga-dubbo-demo
    It also shows verify the error of SCB-547
    click 7.[A.run->B.run, B.run->C.run(x), C.run exception], and org.apache.servicecomb.saga.alpha.core.EventScanner.pollEvents scheduler will stop running.
    TODO: add acceptance test (cucumber)
---
 .../omega-transport/omega-transport-dubbo/pom.xml  |   6 +-
 saga-demo/saga-dubbo-demo/README.md                |  28 ++++
 saga-demo/saga-dubbo-demo/pom.xml                  | 116 +++++++++++++++
 .../saga-dubbo-demo/service-api}/pom.xml           |  30 ++--
 .../servicecomb/saga/demo/dubbo/api/IService.java  |  26 ++++
 .../servicecomb/saga/demo/dubbo/api/IServiceA.java |  21 +++
 .../servicecomb/saga/demo/dubbo/api/IServiceB.java |  22 +++
 .../servicecomb/saga/demo/dubbo/api/IServiceC.java |  22 +++
 .../src/main/resources/dubbo.properties            |  18 +++
 .../saga-dubbo-demo/service-pub}/pom.xml           |  23 +--
 .../saga/demo/dubbo/pub/AbsService.java            |  39 +++++
 .../saga/demo/dubbo/pub/IInvokeCode.java           |  39 +++++
 .../saga/demo/dubbo/pub/InvokeContext.java         |  56 ++++++++
 .../saga-dubbo-demo/servicea}/pom.xml              |  30 ++--
 .../saga/demo/dubbo/servicea/ApplicationA.java     |  31 ++++
 .../saga/demo/dubbo/servicea/ServiceA.java         |  78 ++++++++++
 .../dubbo/servicea/web/DubboDemoController.java    | 157 +++++++++++++++++++++
 .../demo/dubbo/servicea/web/MvcConfigurer.java     |  39 +++++
 .../servicea/src/main/resources/application.yaml   |  23 +++
 .../servicea/src/main/resources/dubbo-context.xml  |  31 ++++
 .../servicea/src/main/resources/jdbc.xml           |  58 ++++++++
 .../servicea/src/main/resources/log4j2.xml         |  30 ++++
 .../servicea/src/main/resources/static/index.html  |  42 ++++++
 .../saga-dubbo-demo/serviceb}/pom.xml              |  30 ++--
 .../saga/demo/dubbo/serviceb/ApplicationB.java     |  32 +++++
 .../saga/demo/dubbo/serviceb/ServiceB.java         |  69 +++++++++
 .../serviceb/src/main/resources/application.yaml   |  22 +++
 .../serviceb/src/main/resources/dubbo-context.xml  |  30 ++++
 .../serviceb/src/main/resources/jdbc.xml           |  57 ++++++++
 .../serviceb/src/main/resources/log4j2.xml         |  30 ++++
 .../saga-dubbo-demo/servicec}/pom.xml              |  30 ++--
 .../saga/demo/dubbo/servicec/ApplicationC.java     |  31 ++++
 .../saga/demo/dubbo/servicec/ServiceC.java         |  61 ++++++++
 .../servicec/src/main/resources/application.yaml   |  22 +++
 .../servicec/src/main/resources/dubbo-context.xml  |  28 ++++
 .../servicec/src/main/resources/jdbc.xml           |  57 ++++++++
 .../servicec/src/main/resources/log4j2.xml         |  30 ++++
 saga-demo/saga-dubbo-demo/sql/schema-mysql.sql     |  43 ++++++
 38 files changed, 1449 insertions(+), 88 deletions(-)

diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/omega/omega-transport/omega-transport-dubbo/pom.xml
index 65893c4..0830266 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/omega/omega-transport/omega-transport-dubbo/pom.xml
@@ -27,12 +27,16 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
+    <properties>
+        <dubbo.version>2.6.1</dubbo.version>
+    </properties>
+
     <artifactId>omega-transport-dubbo</artifactId>
     <dependencies>
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
+            <version>${dubbo.version}</version>
         </dependency>
 
         <dependency>
diff --git a/saga-demo/saga-dubbo-demo/README.md b/saga-demo/saga-dubbo-demo/README.md
new file mode 100644
index 0000000..86ecbf6
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/README.md
@@ -0,0 +1,28 @@
+# Saga-dubbo-demo
+This demo including three services:
+* servicea
+* serviceb
+* servicec
+
+## Prerequisites
+You will need:
+1. [JDK 1.8][jdk]
+2. [Maven 3.x][maven]
+3. [alpha server][alpha_server]
+
+[jdk]: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
+[maven]: https://maven.apache.org/install.html
+[alpha_server]: https://github.com/apache/incubator-servicecomb-saga/tree/master/alpha
+
+## Running Demo
+you can run saga-dubbo-demo as normal spring application
+1.init database: sql/schema-mysql.sql, and config database info by enviroment params
+enviroment params example:
+-Ddatabase.url=jdbc:mysql://127.0.0.1:3306/saga_dubbo
+-Ddatabase.username=root
+-Ddatabase.password=***
+-Dzookeeper.url=localhost:2181
+-Dserver.port=8071
+
+2.config zookeeper url by enviroment param
+3.run servicea, serviceb, servicec,visit http://${servicea_host}:${servicea_port}
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/pom.xml b/saga-demo/saga-dubbo-demo/pom.xml
new file mode 100644
index 0000000..634cd69
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/pom.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<project xmlns="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">
+    <parent>
+        <artifactId>saga-demo</artifactId>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>saga-dubbo-demo</artifactId>
+    <name>Saga::Demo::Saga-dubbo-demo</name>
+    <packaging>pom</packaging>
+
+    <properties>
+        <saga.version>0.2.0-SNAPSHOT</saga.version>
+    </properties>
+
+    <modules>
+        <module>service-api</module>
+        <module>servicea</module>
+        <module>serviceb</module>
+        <module>servicec</module>
+        <module>service-pub</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>${maven-dependency-plugin.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.servicecomb.saga</groupId>
+            <artifactId>omega-transport-dubbo</artifactId>
+            <version>${saga.version} </version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-jdbc</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicecomb.saga</groupId>
+            <artifactId>omega-spring-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicecomb.saga</groupId>
+            <artifactId>omega-spring-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.servicecomb.saga</groupId>
+            <artifactId>omega-transport-resttemplate</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.github.sgroschupf</groupId>
+            <artifactId>zkclient</artifactId>
+            <version>0.1</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>log4j</artifactId>
+                    <groupId>log4j</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-dbcp2</artifactId>
+            <version>2.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>5.1.37</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/saga-demo/saga-dubbo-demo/service-api/pom.xml
similarity index 73%
copy from omega/omega-transport/omega-transport-dubbo/pom.xml
copy to saga-demo/saga-dubbo-demo/service-api/pom.xml
index 65893c4..1347a47 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/service-api/pom.xml
@@ -14,33 +14,31 @@
   ~ 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.
-  ~
   -->
 
 <project xmlns="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">
-    <parent>
-        <artifactId>omega-transport</artifactId>
-        <groupId>org.apache.servicecomb.saga</groupId>
-        <version>0.2.0-SNAPSHOT</version>
-    </parent>
     <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>omega-transport-dubbo</artifactId>
     <dependencies>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-pub</artifactId>
         </dependency>
-
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-pub</artifactId>
+            <version>0.2.0-SNAPSHOT</version>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 
+    <parent>
+        <artifactId>saga-dubbo-demo</artifactId>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>service-api</artifactId>
 
-</project>
+</project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IService.java b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IService.java
new file mode 100644
index 0000000..1269981
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IService.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.demo.dubbo.api;
+
+import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+
+public interface IService {
+
+    public Object run(InvokeContext invokeContext) throws Exception;
+    public void cancelRun(InvokeContext invokeContext);
+
+}
diff --git a/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceA.java b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceA.java
new file mode 100644
index 0000000..17ab38d
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceA.java
@@ -0,0 +1,21 @@
+/*
+ * 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.demo.dubbo.api;
+
+public interface IServiceA extends IService{
+
+}
diff --git a/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceB.java b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceB.java
new file mode 100644
index 0000000..15f734d
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceB.java
@@ -0,0 +1,22 @@
+/*
+ * 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.demo.dubbo.api;
+
+import java.util.Map;
+
+public interface IServiceB extends IService{
+}
diff --git a/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceC.java b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceC.java
new file mode 100644
index 0000000..ef5acb8
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-api/src/main/java/org/apache/servicecomb/saga/demo/dubbo/api/IServiceC.java
@@ -0,0 +1,22 @@
+/*
+ * 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.demo.dubbo.api;
+
+import java.util.Map;
+
+public interface IServiceC extends IService{
+}
diff --git a/saga-demo/saga-dubbo-demo/service-api/src/main/resources/dubbo.properties b/saga-demo/saga-dubbo-demo/service-api/src/main/resources/dubbo.properties
new file mode 100644
index 0000000..b86f300
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-api/src/main/resources/dubbo.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+dubbo.application.qos.enable=false
+dubbo.application.qos.port=33333
\ No newline at end of file
diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/saga-demo/saga-dubbo-demo/service-pub/pom.xml
similarity index 68%
copy from omega/omega-transport/omega-transport-dubbo/pom.xml
copy to saga-demo/saga-dubbo-demo/service-pub/pom.xml
index 65893c4..1ca1310 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/service-pub/pom.xml
@@ -14,33 +14,18 @@
   ~ 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.
-  ~
   -->
-
 <project xmlns="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">
     <parent>
-        <artifactId>omega-transport</artifactId>
-        <groupId>org.apache.servicecomb.saga</groupId>
+        <artifactId>saga-dubbo-demo</artifactId>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
         <version>0.2.0-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>omega-transport-dubbo</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
+    <artifactId>service-pub</artifactId>
 
 
-</project>
+</project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/AbsService.java b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/AbsService.java
new file mode 100644
index 0000000..16f5608
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/AbsService.java
@@ -0,0 +1,39 @@
+/*
+ * 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.demo.dubbo.pub;
+
+import org.springframework.jdbc.core.JdbcTemplate;
+
+import java.util.Map;
+
+public abstract class AbsService {
+
+    @javax.annotation.Resource(name = "jdbcTemplate")
+    protected JdbcTemplate jdbcTemplate;
+
+    public abstract String getServiceName();
+    public abstract String getTableName();
+
+    protected void doRunBusi() {
+        this.jdbcTemplate.update(String.format("update %s set vstatus=? where service = ?", getTableName()), "run", getServiceName());
+    }
+
+    protected void doCancelBusi() {
+        this.jdbcTemplate.update(String.format("update %s set vstatus=? where service = ?", getTableName()), "cancel", getServiceName());
+    }
+
+}
diff --git a/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/IInvokeCode.java b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/IInvokeCode.java
new file mode 100644
index 0000000..b7153ac
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/IInvokeCode.java
@@ -0,0 +1,39 @@
+/*
+ * 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.demo.dubbo.pub;
+
+/**
+ * a invoke code describe a test scenario
+* @date 05/05/2018 3:27 PM
+*/
+public interface IInvokeCode {
+
+    public static final String Ab_description="A->B, success";
+    public static final String Ab = "Ab";
+    public static final String AExceptionWhenAb_description="A->B, A.run exception after A call B.run";
+    public static final String AExceptionWhenAb="AExceptionWhenAb";
+    public static final String BExceptionWhenAb_description="A->B, B.run exception";
+    public static final String BExceptionWhenAb="BExceptionWhenAb";
+    public static final String AbAc_description="A->B, A->C success";
+    public static final String AbAc="AbAc";
+    public static final String CExceptionWhenAbAc_description="A->B,A->C, C.run exception";
+    public static final String CExceptionWhenAbAc="CExceptionWhenAbAc";
+    public static final String AbBc_description="A->B, B->C, success";
+    public static final String AbBc="AbBc";
+    public static final String CExceptionWhenAbBc_description="A->B, B->C, C.run exception";
+    public static final String CExceptionWhenAbBc="CExceptionWhenAbBc";
+}
diff --git a/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/InvokeContext.java b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/InvokeContext.java
new file mode 100644
index 0000000..8225447
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/service-pub/src/main/java/org/apache/servicecomb/saga/demo/dubbo/pub/InvokeContext.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicecomb.saga.demo.dubbo.pub;
+
+public class InvokeContext implements java.io.Serializable{
+
+    private String invokeCode;
+
+    public String getInvokeCode() {
+        return invokeCode;
+    }
+
+    public InvokeContext setInvokeCode(String invokeCode) {
+        this.invokeCode = invokeCode;
+        return this;
+    }
+
+    public boolean isInvokeB(String serviceName) {
+        return "servicea".equals(serviceName) && (IInvokeCode.AExceptionWhenAb.equals(invokeCode)
+                || IInvokeCode.Ab.equals(invokeCode)
+                || IInvokeCode.BExceptionWhenAb.equals(invokeCode)
+                || IInvokeCode.AbAc.equals(invokeCode)
+                || IInvokeCode.CExceptionWhenAbAc.equals(invokeCode)
+                || IInvokeCode.AbBc.equals(invokeCode)
+                || IInvokeCode.CExceptionWhenAbBc.equals(invokeCode));
+    }
+
+    public boolean isInvokeC(String serviceName) {
+        return ("serviceb".equals(serviceName) && IInvokeCode.AbBc.equals(invokeCode))
+                || ("serviceb".equals(serviceName) && IInvokeCode.CExceptionWhenAbBc.equals(invokeCode))
+                || ("servicea".equals(serviceName) && IInvokeCode.AbAc.equals(invokeCode))
+                || ("servicea".equals(serviceName) && IInvokeCode.CExceptionWhenAbAc.equals(invokeCode));
+    }
+
+    public boolean isException(String serviceName) {
+        return ("servicea".equals(serviceName) && IInvokeCode.AExceptionWhenAb.equals(invokeCode))
+               || ("serviceb".equals(serviceName) && IInvokeCode.BExceptionWhenAb.equals(invokeCode))
+                || ("servicec".equals(serviceName) && (IInvokeCode.CExceptionWhenAbAc.equals(invokeCode)
+                || IInvokeCode.CExceptionWhenAbBc.equals(invokeCode)));
+    }
+
+}
diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/saga-demo/saga-dubbo-demo/servicea/pom.xml
similarity index 73%
copy from omega/omega-transport/omega-transport-dubbo/pom.xml
copy to saga-demo/saga-dubbo-demo/servicea/pom.xml
index 65893c4..1360034 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/servicea/pom.xml
@@ -14,33 +14,31 @@
   ~ 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.
-  ~
   -->
 
 <project xmlns="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">
-    <parent>
-        <artifactId>omega-transport</artifactId>
-        <groupId>org.apache.servicecomb.saga</groupId>
-        <version>0.2.0-SNAPSHOT</version>
-    </parent>
     <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>omega-transport-dubbo</artifactId>
     <dependencies>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-api</artifactId>
+            <version>${saga.version}</version>
         </dependency>
-
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-pub</artifactId>
+            <version>${saga.version}</version>
         </dependency>
     </dependencies>
 
+    <parent>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
+        <artifactId>saga-dubbo-demo</artifactId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>servicea</artifactId>
 
-</project>
+</project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ApplicationA.java b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ApplicationA.java
new file mode 100644
index 0000000..ace9358
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ApplicationA.java
@@ -0,0 +1,31 @@
+/*
+ * 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.demo.dubbo.servicea;
+import org.apache.servicecomb.saga.omega.spring.EnableOmega;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ImportResource;
+
+@SpringBootApplication
+@EnableOmega
+@ImportResource({"dubbo-context.xml", "jdbc.xml"})
+public class ApplicationA {
+  public static void main(String[] args) {
+    SpringApplication.run(ApplicationA.class, args);
+  }
+}
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ServiceA.java b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ServiceA.java
new file mode 100644
index 0000000..dad5259
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/ServiceA.java
@@ -0,0 +1,78 @@
+/*
+ * 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.demo.dubbo.servicea;
+
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceA;
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceB;
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceC;
+import org.apache.servicecomb.saga.demo.dubbo.pub.AbsService;
+import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+import org.apache.servicecomb.saga.omega.context.annotations.SagaStart;
+import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.lang.invoke.MethodHandles;
+
+public class ServiceA extends AbsService implements IServiceA {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    @Autowired
+    private IServiceB serviceB;
+
+    @Autowired
+    private IServiceC serviceC;
+
+    @Override
+    public String getServiceName() {
+        return "servicea";
+    }
+
+    @Override
+    public String getTableName() {
+        return "testa";
+    }
+
+    @Override
+    @SagaStart
+    @Compensable( compensationMethod="cancelRun")
+    @Transactional(rollbackFor = Exception.class)
+    public Object run(InvokeContext invokeContext) throws Exception {
+        LOG.info("A.run called");
+        doRunBusi();
+        if(invokeContext.isInvokeB(getServiceName())){
+            serviceB.run(invokeContext);
+        }
+        if(invokeContext.isInvokeC(getServiceName())){
+            serviceC.run(invokeContext);
+        }
+        if(invokeContext.isException(getServiceName()) ){
+            LOG.info("A.run exception");
+            throw new Exception("A.run exception");
+        }
+        return null;
+    }
+
+    public void cancelRun(InvokeContext invokeContext){
+        LOG.info("A.cancel called");
+        doCancelBusi();
+    }
+
+}
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java
new file mode 100644
index 0000000..c2c9eb3
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/DubboDemoController.java
@@ -0,0 +1,157 @@
+/*
+ * 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.demo.dubbo.servicea.web;
+
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceA;
+import org.apache.servicecomb.saga.demo.dubbo.pub.IInvokeCode;
+import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class DubboDemoController {
+
+  @Autowired
+  private IServiceA serviceA;
+
+    @javax.annotation.Resource(name = "jdbcTemplate")
+    protected JdbcTemplate jdbcTemplate;
+
+
+  @GetMapping("/serviceInvoke/Ab")
+  public String serviceInvokeAb() throws Exception {
+      serviceInvoke(IInvokeCode.Ab);
+      String status_a = getServiceStatus("testa");
+      String status_b = getServiceStatus("testb");
+      boolean checkResult = checkResult("run", status_a, "run", status_b);
+      return String.format(IInvokeCode.Ab_description +
+              "</br>check result: %s" +
+              "</br>expected status: A:run, B:run" +
+              "</br> actual status: A:%s, B:%s", checkResult, status_a, status_b);
+  }
+
+    private boolean checkResult(String... statusArray) {
+      for(int i=0; i<statusArray.length; i++){
+          if(i%2==0 && i<statusArray.length){
+              if(!statusArray[i].equals(statusArray[i+1])) return false;
+          }
+      }
+      return true;
+    }
+
+    @GetMapping("/serviceInvoke/AExceptionWhenAb")
+    public String serviceInvokeAExceptionWhenAb() throws Exception {
+        serviceInvoke(IInvokeCode.AExceptionWhenAb);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        boolean checkResult = checkResult("init", status_a, "cancel", status_b);
+        return String.format(IInvokeCode.AExceptionWhenAb_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:init, B:cancel" +
+                "</br> actual status: A:%s, B:%s", checkResult, status_a, status_b);
+    }
+
+    @GetMapping("/serviceInvoke/BExceptionWhenAb")
+    public String serviceInvokeBExceptionWhenAb() throws Exception {
+        serviceInvoke(IInvokeCode.BExceptionWhenAb);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        boolean checkResult = checkResult("init", status_a, "init", status_b);
+        return String.format(IInvokeCode.BExceptionWhenAb_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:init, B:init" +
+                "</br> actual status: A:%s, B:%s", checkResult, status_a, status_b);
+    }
+
+    @GetMapping("/serviceInvoke/AbAc")
+    public String serviceInvokeAbAc() throws Exception {
+        serviceInvoke(IInvokeCode.AbAc);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        String status_c = getServiceStatus("testc");
+        boolean checkResult = checkResult("run", status_a, "run", status_b, "run", status_c);
+        return String.format(IInvokeCode.AbAc_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:run, B:run, C:run" +
+                "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
+    }
+
+    @GetMapping("/serviceInvoke/CExceptionWhenAbAc")
+    public String serviceInvokeCExceptionWhenAbAc() throws Exception {
+        serviceInvoke(IInvokeCode.CExceptionWhenAbAc);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        String status_c = getServiceStatus("testc");
+        boolean checkResult = checkResult("init", status_a, "init", status_b, "init", status_c);
+        return String.format(IInvokeCode.CExceptionWhenAbAc_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:init, B:init, C:init" +
+                "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
+    }
+
+    @GetMapping("/serviceInvoke/AbBc")
+    public String serviceInvokeAbBc() throws Exception {
+        serviceInvoke(IInvokeCode.AbBc);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        String status_c = getServiceStatus("testc");
+        boolean checkResult = checkResult("run", status_a, "run", status_b, "run", status_c);
+        return String.format(IInvokeCode.AbBc_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:run, B:run, C:run" +
+                "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
+    }
+
+    @GetMapping("/serviceInvoke/CExceptionWhenAbBc")
+    public String serviceInvokeCExceptionWhenAbBc() throws Exception {
+        serviceInvoke(IInvokeCode.CExceptionWhenAbBc);
+        String status_a = getServiceStatus("testa");
+        String status_b = getServiceStatus("testb");
+        String status_c = getServiceStatus("testc");
+        boolean checkResult = checkResult("init", status_a, "init", status_b, "init", status_c);
+        return String.format(IInvokeCode.CExceptionWhenAbBc_description +
+                "</br>check result: %s" +
+                "</br>expected status: A:init, B:init, C:init" +
+                "</br> actual status: A:%s, B:%s, C: %s", checkResult, status_a, status_b, status_c);
+    }
+
+    public void serviceInvoke(String invokeCode) throws InterruptedException {
+        reset();
+        try{
+            serviceA.run(new InvokeContext().setInvokeCode(invokeCode));
+        }catch (Exception e){
+            e.printStackTrace();
+            //wait for compensate execute
+            Thread.sleep(1000);
+        }
+
+    }
+
+    public void reset() {
+        this.jdbcTemplate.update("update testa set vstatus=? ", "init");
+        this.jdbcTemplate.update("update testb set vstatus=? ", "init");
+        this.jdbcTemplate.update("update testc set vstatus=? ", "init");
+    }
+
+    public String getServiceStatus(String tableName){
+      return this.jdbcTemplate.queryForObject(String.format("select vstatus from %s", tableName), String.class);
+    }
+
+}
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/MvcConfigurer.java b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/MvcConfigurer.java
new file mode 100644
index 0000000..d815f60
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicea/web/MvcConfigurer.java
@@ -0,0 +1,39 @@
+/*
+ * 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.demo.dubbo.servicea.web;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.Ordered;
+import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
+import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
+
+@Configuration
+public class MvcConfigurer extends WebMvcConfigurerAdapter {
+  
+    @Override  
+    public void addViewControllers(ViewControllerRegistry registry) {
+        registry.addViewController("/error").setViewName("error.html");  
+        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
+    }
+    
+    @Override  
+    public void configurePathMatch(PathMatchConfigurer configurer) {
+        super.configurePathMatch(configurer);  
+        configurer.setUseSuffixPatternMatch(false);  
+    }
+}
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml
new file mode 100644
index 0000000..3880847
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/application.yaml
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+spring:
+  application:
+    name: servicea
+alpha:
+  cluster:
+    address: localhost:8080
+
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/dubbo-context.xml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/dubbo-context.xml
new file mode 100644
index 0000000..1c73e90
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/dubbo-context.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+    <dubbo:application name="dubbo-servicea"/>
+    <dubbo:consumer check="false" timeout="10000" />
+    <!--localhost:2181-->
+    <dubbo:registry address="zookeeper://${zookeeper.url}?client=zkclient"/>
+    <dubbo:protocol name="dubbo" port="20881"/>
+    <dubbo:service interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceA" ref="servicea"/>
+    <bean id="servicea" class="org.apache.servicecomb.saga.demo.dubbo.servicea.ServiceA"/>
+    <dubbo:reference id="serviceb" interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceB"/>
+    <dubbo:reference id="servicec" interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceC"/>
+</beans>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml
new file mode 100644
index 0000000..001ee81
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/jdbc.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans    
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
+           http://www.springframework.org/schema/context    
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
+           http://www.springframework.org/schema/aop    
+           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
+           http://www.springframework.org/schema/tx 
+           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
+		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
+		<!--jdbc:mysql://127.0.0.1:3306/saga_dubbo-->
+		<property name="url" value="${database.url}" />
+		<property name="username" value="${database.username}" />
+		<property name="password" value="${database.password}" />
+		<property name="maxTotal" value="50" />
+		<property name="initialSize" value="20" />
+		<property name="maxWaitMillis" value="60000" />
+		<property name="minIdle" value="6" />
+		<property name="logAbandoned" value="true" />
+		<property name="removeAbandonedOnMaintenance" value="true" />
+		<property name="removeAbandonedOnBorrow" value="true" />
+		<property name="removeAbandonedTimeout" value="1800" />
+
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		<property name="validationQuery" value="select 'x' " />
+		<property name="validationQueryTimeout" value="1" />
+		<property name="timeBetweenEvictionRunsMillis" value="30000" />
+		<property name="numTestsPerEvictionRun" value="20" />
+	</bean>
+
+	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+</beans>
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..eb57a2d
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="debug">
+      <AppenderRef ref="Console"/>
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/saga-demo/saga-dubbo-demo/servicea/src/main/resources/static/index.html b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/static/index.html
new file mode 100644
index 0000000..f366003
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicea/src/main/resources/static/index.html
@@ -0,0 +1,42 @@
+<!--
+  ~ 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.
+  -->
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta charset="utf-8">
+    <title>saga-dubbo-demo</title>
+    <meta name="description" content="">
+    <meta name="author" content="">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="">
+    <!--[if lt IE 9]>
+    <script src="//cdn.jsdelivr.net/html5shiv/3.7.2/html5shiv.min.js"></script>
+    <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
+    <![endif]-->
+    <link rel="shortcut icon" href="">
+</head>
+<body>
+<p>1.<a href="/serviceInvoke/Ab" target="_blank">[A.run->B.run, success]</a> </p>
+<p>2.<a href="/serviceInvoke/AExceptionWhenAb" target="_blank">[A.run(x)->B.run, A.run exception after call B.run]</a> </p>
+<p>3.<a href="/serviceInvoke/BExceptionWhenAb" target="_blank">[A.run->B.run(x), B.run exception]</a> </p>
+<p>4.<a href="/serviceInvoke/AbAc" target="_blank">[A.run->B.run, A.run->C.run, success]</a> </p>
+<p>5.<a href="/serviceInvoke/CExceptionWhenAbAc" target="_blank">[A.run->B.run, A.run->C.run(x), C.run exception]</a> </p>
+<p>6.<a href="/serviceInvoke/AbBc" target="_blank">[A.run->B.run, B.run->C.run, success]</a></p>
+<p>7.<a href="/serviceInvoke/CExceptionWhenAbBc" target="_blank">[A.run->B.run, B.run->C.run(x), C.run exception]</a> </p>
+</body>
+</html>
\ No newline at end of file
diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/saga-demo/saga-dubbo-demo/serviceb/pom.xml
similarity index 73%
copy from omega/omega-transport/omega-transport-dubbo/pom.xml
copy to saga-demo/saga-dubbo-demo/serviceb/pom.xml
index 65893c4..bbfceb6 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/serviceb/pom.xml
@@ -14,33 +14,27 @@
   ~ 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.
-  ~
   -->
 
 <project xmlns="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">
-    <parent>
-        <artifactId>omega-transport</artifactId>
-        <groupId>org.apache.servicecomb.saga</groupId>
-        <version>0.2.0-SNAPSHOT</version>
-    </parent>
     <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>omega-transport-dubbo</artifactId>
     <dependencies>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-api</artifactId>
+            <version>0.2.0-SNAPSHOT</version>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 
+    <parent>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
+        <artifactId>saga-dubbo-demo</artifactId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>serviceb</artifactId>
 
-</project>
+</project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ApplicationB.java b/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ApplicationB.java
new file mode 100644
index 0000000..e31c375
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ApplicationB.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.servicecomb.saga.demo.dubbo.serviceb;
+
+import org.apache.servicecomb.saga.omega.spring.EnableOmega;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ImportResource;
+
+@SpringBootApplication
+@EnableOmega
+@ImportResource({"dubbo-context.xml", "jdbc.xml"})
+public class ApplicationB {
+  public static void main(String[] args) {
+    SpringApplication.run(ApplicationB.class, args);
+  }
+}
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ServiceB.java b/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ServiceB.java
new file mode 100644
index 0000000..0c7890f
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/java/org/apache/servicecomb/saga/demo/dubbo/serviceb/ServiceB.java
@@ -0,0 +1,69 @@
+/*
+ * 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.demo.dubbo.serviceb;
+
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceB;
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceC;
+import org.apache.servicecomb.saga.demo.dubbo.pub.AbsService;
+import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.lang.invoke.MethodHandles;
+
+public class ServiceB extends AbsService implements IServiceB {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    @Autowired
+    private IServiceC serviceC;
+
+    @Override
+    public String getServiceName() {
+        return "serviceb";
+    }
+
+    @Override
+    public String getTableName() {
+        return "testb";
+    }
+
+    @Override
+    @Compensable( compensationMethod="cancelRun")
+    @Transactional(rollbackFor = Exception.class)
+    public Object run(InvokeContext invokeContext) throws Exception {
+        LOG.info("B.run called");
+       doRunBusi();
+       if(invokeContext.isInvokeC(getServiceName())){
+           serviceC.run(invokeContext);
+       }
+        if(invokeContext.isException(getServiceName())){
+            throw new Exception("B.run exception");
+        }
+
+        return null;
+    }
+
+    public void cancelRun(InvokeContext invokeContext){
+        LOG.info("B.cancel called");
+        doCancelBusi();
+    }
+
+}
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml
new file mode 100644
index 0000000..f78027a
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/application.yaml
@@ -0,0 +1,22 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+spring:
+  application:
+    name: serviceb
+alpha:
+  cluster:
+    address: localhost:8080
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/dubbo-context.xml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/dubbo-context.xml
new file mode 100644
index 0000000..519900e
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/dubbo-context.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+    <dubbo:application name="dubbo-serviceb"/>
+    <dubbo:consumer check="false" timeout="10000" />
+    <!--localhost:2181-->
+    <dubbo:registry address="zookeeper://${zookeeper.url}?client=zkclient"/>
+    <dubbo:protocol name="dubbo" port="20882"/>
+    <dubbo:service interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceB" ref="serviceb"/>
+    <bean id="serviceb" class="org.apache.servicecomb.saga.demo.dubbo.serviceb.ServiceB"/>
+    <dubbo:reference id="servicec" interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceC"/>
+</beans>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml
new file mode 100644
index 0000000..3bdafa1
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/jdbc.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans    
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
+           http://www.springframework.org/schema/context    
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
+           http://www.springframework.org/schema/aop    
+           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
+           http://www.springframework.org/schema/tx 
+           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
+		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
+		<property name="url" value="${database.url}" />
+		<property name="username" value="${database.username}" />
+		<property name="password" value="${database.password}" />
+		<property name="maxTotal" value="50" />
+		<property name="initialSize" value="20" />
+		<property name="maxWaitMillis" value="60000" />
+		<property name="minIdle" value="6" />
+		<property name="logAbandoned" value="true" />
+		<property name="removeAbandonedOnMaintenance" value="true" />
+		<property name="removeAbandonedOnBorrow" value="true" />
+		<property name="removeAbandonedTimeout" value="1800" />
+
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		<property name="validationQuery" value="select 'x' " />
+		<property name="validationQueryTimeout" value="1" />
+		<property name="timeBetweenEvictionRunsMillis" value="30000" />
+		<property name="numTestsPerEvictionRun" value="20" />
+	</bean>
+
+	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+</beans>
diff --git a/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..eb57a2d
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/serviceb/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="debug">
+      <AppenderRef ref="Console"/>
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/omega/omega-transport/omega-transport-dubbo/pom.xml b/saga-demo/saga-dubbo-demo/servicec/pom.xml
similarity index 73%
copy from omega/omega-transport/omega-transport-dubbo/pom.xml
copy to saga-demo/saga-dubbo-demo/servicec/pom.xml
index 65893c4..79cdd4d 100644
--- a/omega/omega-transport/omega-transport-dubbo/pom.xml
+++ b/saga-demo/saga-dubbo-demo/servicec/pom.xml
@@ -14,33 +14,27 @@
   ~ 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.
-  ~
   -->
 
 <project xmlns="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">
-    <parent>
-        <artifactId>omega-transport</artifactId>
-        <groupId>org.apache.servicecomb.saga</groupId>
-        <version>0.2.0-SNAPSHOT</version>
-    </parent>
     <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>omega-transport-dubbo</artifactId>
     <dependencies>
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>dubbo</artifactId>
-            <version>2.6.1</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-            <scope>test</scope>
+            <groupId>org.apache.servicecomb.saga.demo</groupId>
+            <artifactId>service-api</artifactId>
+            <version>0.2.0-SNAPSHOT</version>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 
+    <parent>
+        <groupId>org.apache.servicecomb.saga.demo</groupId>
+        <artifactId>saga-dubbo-demo</artifactId>
+        <version>0.2.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>servicec</artifactId>
 
-</project>
+</project>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ApplicationC.java b/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ApplicationC.java
new file mode 100644
index 0000000..4fdfe25
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ApplicationC.java
@@ -0,0 +1,31 @@
+/*
+ * 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.demo.dubbo.servicec;
+import org.apache.servicecomb.saga.omega.spring.EnableOmega;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.ImportResource;
+
+@SpringBootApplication
+@EnableOmega
+@ImportResource({"dubbo-context.xml", "jdbc.xml"})
+public class ApplicationC {
+  public static void main(String[] args) {
+    SpringApplication.run(ApplicationC.class, args);
+  }
+}
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ServiceC.java b/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ServiceC.java
new file mode 100644
index 0000000..1f8d63e
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/java/org/apache/servicecomb/saga/demo/dubbo/servicec/ServiceC.java
@@ -0,0 +1,61 @@
+/*
+ * 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.demo.dubbo.servicec;
+
+import org.apache.servicecomb.saga.demo.dubbo.api.IServiceC;
+import org.apache.servicecomb.saga.demo.dubbo.pub.AbsService;
+import org.apache.servicecomb.saga.demo.dubbo.pub.InvokeContext;
+import org.apache.servicecomb.saga.omega.transaction.annotations.Compensable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.lang.invoke.MethodHandles;
+
+public class ServiceC extends AbsService implements IServiceC {
+
+    private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+    @Override
+    public String getServiceName() {
+        return "servicec";
+    }
+
+    @Override
+    public String getTableName() {
+        return "testc";
+    }
+
+    @Override
+    @Compensable(compensationMethod="cancelRun")
+    @Transactional(rollbackFor = Exception.class)
+    public Object run(InvokeContext invokeContext) throws Exception {
+        LOG.info("C.run called");
+        doRunBusi();
+        if(invokeContext.isException(getServiceName()) ){
+            LOG.info("C.run exception");
+            throw new Exception("C.run exception");
+        }
+        return null;
+    }
+
+    public void cancelRun(InvokeContext invokeContext){
+        LOG.info("C.cancel called");
+        doCancelBusi();
+    }
+
+}
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml
new file mode 100644
index 0000000..0535557
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/application.yaml
@@ -0,0 +1,22 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+spring:
+  application:
+    name: servicec
+alpha:
+  cluster:
+    address: localhost:8080
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/dubbo-context.xml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/dubbo-context.xml
new file mode 100644
index 0000000..b37d8a4
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/dubbo-context.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+    <dubbo:application name="dubbo-servicec"/>
+    <!--localhost:2181-->
+    <dubbo:registry address="zookeeper://${zookeeper.url}?client=zkclient"/>
+    <dubbo:protocol name="dubbo" port="20883"/>
+    <dubbo:service interface="org.apache.servicecomb.saga.demo.dubbo.api.IServiceC" ref="servicec"/>
+    <bean id="servicec" class="org.apache.servicecomb.saga.demo.dubbo.servicec.ServiceC"/>
+</beans>
\ No newline at end of file
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml
new file mode 100644
index 0000000..3bdafa1
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/jdbc.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop"
+	xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans    
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
+           http://www.springframework.org/schema/context    
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd    
+           http://www.springframework.org/schema/aop    
+           http://www.springframework.org/schema/aop/spring-aop-3.0.xsd    
+           http://www.springframework.org/schema/tx 
+           http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
+
+	<bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
+		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
+		<property name="url" value="${database.url}" />
+		<property name="username" value="${database.username}" />
+		<property name="password" value="${database.password}" />
+		<property name="maxTotal" value="50" />
+		<property name="initialSize" value="20" />
+		<property name="maxWaitMillis" value="60000" />
+		<property name="minIdle" value="6" />
+		<property name="logAbandoned" value="true" />
+		<property name="removeAbandonedOnMaintenance" value="true" />
+		<property name="removeAbandonedOnBorrow" value="true" />
+		<property name="removeAbandonedTimeout" value="1800" />
+
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		<property name="validationQuery" value="select 'x' " />
+		<property name="validationQueryTimeout" value="1" />
+		<property name="timeBetweenEvictionRunsMillis" value="30000" />
+		<property name="numTestsPerEvictionRun" value="20" />
+	</bean>
+
+	<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
+		<property name="dataSource" ref="dataSource" />
+	</bean>
+
+</beans>
diff --git a/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..eb57a2d
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/servicec/src/main/resources/log4j2.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<Configuration status="WARN">
+  <Appenders>
+    <Console name="Console" target="SYSTEM_OUT">
+      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
+    </Console>
+  </Appenders>
+  <Loggers>
+    <AsyncRoot level="debug">
+      <AppenderRef ref="Console"/>
+    </AsyncRoot>
+  </Loggers>
+</Configuration>
diff --git a/saga-demo/saga-dubbo-demo/sql/schema-mysql.sql b/saga-demo/saga-dubbo-demo/sql/schema-mysql.sql
new file mode 100644
index 0000000..d9d0743
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/sql/schema-mysql.sql
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+create database saga_dubbo;
+use saga_dubbo;
+
+CREATE TABLE `testa` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
+INSERT INTO `testa` (`id`, `service`, `vstatus`) VALUES ('1','servicea','init');
+
+CREATE TABLE `testb` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
+INSERT INTO `testb` (`id`, `service`, `vstatus`) VALUES ('2','serviceb','init');
+
+CREATE TABLE `testc` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `service` varchar(128) DEFAULT NULL,
+  `vstatus` varchar(128) DEFAULT NULL,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
+INSERT INTO `testc` (`id`, `service`, `vstatus`) VALUES ('3','servicec','init');
\ No newline at end of file

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

[incubator-servicecomb-saga] 06/12: saga-dubbo-demo add docker plugin(part1)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e1119d0bbc0f96d2e2023a5aeeb897a06f521cd7
Author: wuzunqian <wu...@msn.com>
AuthorDate: Sun May 13 14:51:52 2018 +0800

    saga-dubbo-demo add docker plugin(part1)
---
 .../saga-dubbo-demo/docker-compose.mysql.yaml      | 39 +++++++++++++++++
 saga-demo/saga-dubbo-demo/docker-compose.yaml      | 51 ++++++++++++++++++++++
 saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh       | 45 +++++++++++++++++++
 3 files changed, 135 insertions(+)

diff --git a/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml b/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml
new file mode 100644
index 0000000..43f3b5e
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/docker-compose.mysql.yaml
@@ -0,0 +1,39 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+version: '2.1'
+
+services:
+  database:
+    image: "mysql/mysql-server:5.7"
+    hostname: mysql
+    environment:
+      - MYSQL_ROOT_PASSWORD=password
+      - MYSQL_DATABASE=saga
+      - MYSQL_USER=saga
+      - MYSQL_PASSWORD=password
+    healthcheck:
+        test: ["CMD-SHELL", "nc -z localhost 3306 &> /dev/null; echo $$?"]
+        interval: 30s
+        timeout: 10s
+        retries: 5
+
+  alpha:
+    links:
+      - "database:mysql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=-Dspring.profiles.active=mysql
diff --git a/saga-demo/saga-dubbo-demo/docker-compose.yaml b/saga-demo/saga-dubbo-demo/docker-compose.yaml
new file mode 100644
index 0000000..7c3b8dd
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/docker-compose.yaml
@@ -0,0 +1,51 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+version: '2.1'
+
+services:
+  database:
+    image: "postgres"
+    hostname: postgres
+    environment:
+      - POSTGRES_DB=saga
+      - POSTGRES_USER=saga
+      - POSTGRES_PASSWORD=password
+    healthcheck:
+        test: ["CMD-SHELL", "nc -z localhost 5432 &> /dev/null; echo $$?"]
+        interval: 30s
+        timeout: 10s
+        retries: 5
+
+  alpha:
+    image: "alpha-server:${TAG}"
+    hostname: alpha-server
+    ports:
+      - "8081:8080"
+      - "8091:8090"
+    links:
+      - "database:postgresql.servicecomb.io"
+    environment:
+      - JAVA_OPTS=-Dspring.profiles.active=prd
+    healthcheck:
+        test: ["CMD-SHELL", "nc -z localhost 8080 &> /dev/null; echo $$?"]
+        interval: 30s
+        timeout: 10s
+        retries: 5
+    depends_on:
+      database:
+        condition: service_healthy
diff --git a/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
new file mode 100755
index 0000000..48df117
--- /dev/null
+++ b/saga-demo/saga-dubbo-demo/saga-dubbo-demo.sh
@@ -0,0 +1,45 @@
+#!/usr/bin/env bash
+
+service=saga-dubbo-demo
+
+show_usage() {
+  echo "Usage: $0 {up|up-mysql|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 $?
+  ;;
+  
+  up-mysql)
+    fetch_version
+    echo "Starting ${service}:${version}"
+    TAG=$version docker-compose -f docker-compose.yaml -f docker-compose.mysql.yaml up
+    exit $?
+  ;;
+  
+  down)
+    fetch_version
+    echo "Stopping ${service}:${version}"
+    TAG=$version docker-compose down
+    exit $?
+  ;;
+  
+  *)
+    show_usage
+    exit 2
+  ;;
+esac
+

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