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/04/14 07:18:19 UTC

[incubator-servicecomb-saga] branch master updated: SCB-300 update to modify the timeout value in the byteman rule

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

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


The following commit(s) were added to refs/heads/master by this push:
     new be37cfe  SCB-300 update to modify the timeout value in the byteman rule
be37cfe is described below

commit be37cfe5e9a6ccad8fcd52c43d75e69c079f492b
Author: Zheng Feng <zh...@gmail.com>
AuthorDate: Fri Apr 13 23:11:05 2018 +0800

    SCB-300 update to modify the timeout value in the byteman rule
---
 .../acceptance-pack/src/test/resources/booking_timeout.btm        | 8 ++++++++
 .../servicecomb/saga/demo/pack/booking/BookingController.java     | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/acceptance-tests/acceptance-pack/src/test/resources/booking_timeout.btm b/acceptance-tests/acceptance-pack/src/test/resources/booking_timeout.btm
index a41bf98..2deab51 100644
--- a/acceptance-tests/acceptance-pack/src/test/resources/booking_timeout.btm
+++ b/acceptance-tests/acceptance-pack/src/test/resources/booking_timeout.btm
@@ -18,6 +18,14 @@
 #
 ###############################################################
 
+RULE set the saga timeout to 5s
+INTERFACE org.apache.servicecomb.saga.omega.context.annotations.SagaStart
+METHOD timeout
+AT EXIT
+IF TRUE
+DO RETURN 5
+ENDRULE
+
 RULE sleep when postBooking until timeout happens
 CLASS org.apache.servicecomb.saga.demo.pack.booking.BookingController
 METHOD postBooking
diff --git a/saga-demo/booking/booking/src/main/java/org/apache/servicecomb/saga/demo/pack/booking/BookingController.java b/saga-demo/booking/booking/src/main/java/org/apache/servicecomb/saga/demo/pack/booking/BookingController.java
index 3d6c2ce..c194811 100644
--- a/saga-demo/booking/booking/src/main/java/org/apache/servicecomb/saga/demo/pack/booking/BookingController.java
+++ b/saga-demo/booking/booking/src/main/java/org/apache/servicecomb/saga/demo/pack/booking/BookingController.java
@@ -37,7 +37,7 @@ public class BookingController {
   @Autowired
   private RestTemplate template;
 
-  @SagaStart(timeout = 5)
+  @SagaStart
   @PostMapping("/booking/{name}/{rooms}/{cars}")
   public String order(@PathVariable String name,  @PathVariable Integer rooms, @PathVariable Integer cars) {
     template.postForEntity(

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