You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "zhfeng (via GitHub)" <gi...@apache.org> on 2023/02/14 07:04:28 UTC

[GitHub] [camel] zhfeng opened a new pull request, #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

zhfeng opened a new pull request, #9344:
URL: https://github.com/apache/camel/pull/9344

   # Description
   
   <!--
   - Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   -->
   
   # Target
   
   - [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   <!--
   # *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
   -->
   
   # Apache Camel coding standards and style
   
   - [ ] I checked that each commit in the pull request has a meaningful subject line and body.
   
   <!--  
   If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   -->
   
   - [ ] I formatted the code using `mvn -Pformat,fastinstall install && mvn -Psourcecheck`
   
   <!-- 
   You can run the aforementioned command in your module so that the build auto-formats your code and the source check verifies that is complies with our coding style. This will also be verified as part of the checks and your PR may be rejected if the checkstyle does not pass.
   
   You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108224176


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);
+
+        MockEndpoint complete = getMockEndpoint("mock:complete");
+        complete.expectedMessageCount(2);

Review Comment:
   OK, I use `complete.assertIsNotSatisfied();` but yeah, it coud be more clearer with 
   ```java
   complete.expectedMessageCount(0); 
   ...
   complete.assertIsSatisfied();
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1433011064

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1433044815

   > @essobedo Did you check this [discussion](https://narayana.zulipchat.com/#narrow/stream/323714-users/topic/Saga.20timeout.20value.20depend.20on.20what.20.3F) on narayana zulip?
   > 
   > > When a participant joins an existing LRA it is allowed to specify a new timeout, provided it is earlier than the one currently in effect, because the ability of a participant to be able to compensate may be time bound, i.e. if the new timelimit is earlier than the current one than it becomes the new limit and the LRA will be cancelled when the limit is reached if still active.
   > 
   > I think it follows the LRA Spec [1]
   > 
   > [1] https://download.eclipse.org/microprofile/microprofile-lra-2.0-RC1/microprofile-lra-spec-2.0-RC1.html#timing-out-lras-and-compensators
   
   No I didn't but it is not even the behavior, we have right now, instead of replacing an existing timeout, the timeout is extended. I mean, if I have 2 participants, and the timeouts set are 2 s for the first participant and 1 s for the second participant, instead of having the minimum of the 2 timeouts which is 1 s, we have the minimum of (2 s and the time of the first action + 1 s).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1106505254


##########
core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java:
##########
@@ -75,6 +75,13 @@ public String getId() {
 
     @Override
     public CompletableFuture<Void> beginStep(Exchange exchange, CamelSagaStep step) {
+        Status status = currentStatus.get();
+        if (status != Status.RUNNING) {
+            CompletableFuture<Void> res = new CompletableFuture<>();
+            res.completeExceptionally(new IllegalStateException("Cannot begin: status is " + status));
+            return res;
+        }
+

Review Comment:
   Sure and thanks for pointing the src directory out. I was thinking about a test case but have not find the right place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432953155

   @essobedo Did you check this [discussion](https://narayana.zulipchat.com/#narrow/stream/323714-users/topic/Saga.20timeout.20value.20depend.20on.20what.20.3F) on narayana zulip? 
   
   >When a participant joins an existing LRA it is allowed to specify a new timeout, provided it is earlier than the one currently in effect, because the ability of a participant to be able to compensate may be time bound, i.e. if the new timelimit is earlier than the current one than it becomes the new limit and the LRA will be cancelled when the limit is reached if still active.
   
   I think it follows the LRA Spec [1]
   
   [1] https://download.eclipse.org/microprofile/microprofile-lra-2.0-RC1/microprofile-lra-spec-2.0-RC1.html#timing-out-lras-and-compensators


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432451924

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432454371

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108219812


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -81,6 +110,29 @@ public void configure() throws Exception {
                         .compensation("mock:compensate").completion("mock:complete")
                         .to("mock:end");
 
+                from("direct:saga-multi-participants")
+                        .process(exchange -> {
+                            exchange.getMessage().setHeader("id", UUID.randomUUID().toString());
+                        })
+                        .saga()
+                        .propagation(SagaPropagation.REQUIRES_NEW)
+                        .to("direct:service1")
+                        .to("direct:service2");
+
+                from("direct:service1")
+                        .saga().option("id", header("id"))
+                        .propagation(SagaPropagation.MANDATORY).timeout(100, TimeUnit.MILLISECONDS)
+                        .compensation("mock:compensate").completion("mock:complete")
+                        .process(exchange -> {
+                            Thread.sleep(300L, 0);
+                        })

Review Comment:
   Nice catch! I will change to use `deplay`. Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108221961


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);

Review Comment:
   There is only `service1` involved in the saga transction. `service2` can not join because the status is `COMPENSATED`. So I think it should be `1`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108261541


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);
+
+        MockEndpoint complete = getMockEndpoint("mock:complete");
+        complete.expectedMessageCount(2);

Review Comment:
   Oh, I missed that, it would be definitively more clear 😄 It makes me wonder in which case `assertIsNotSatisfied` can be useful, it sounds like a very dangerous method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432934947

   @chen19980 No, you don't need to edit this PR. You can create a new PR to fix `core/camel-core-engine/src/main/docs/modules/eips/pages/saga-eip.adoc`. Feel free to ping me if you have any problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108257530


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);

Review Comment:
   Ah ok, that makes sense indeed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1434101482

   SagaPropagationTest#testPropagationSupports is failing with this fix and it should be fix in
   - https://github.com/apache/camel/pull/9368
   
   I'm just curious why the CI did not find this failing test when checking this PR? @oscerd is there anything we are missing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] oscerd commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1434176109

   It could be the module containing saga propagation test was not part of the tests triggered


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1105933476


##########
core/camel-support/src/main/java/org/apache/camel/saga/InMemorySagaCoordinator.java:
##########
@@ -75,6 +75,13 @@ public String getId() {
 
     @Override
     public CompletableFuture<Void> beginStep(Exchange exchange, CamelSagaStep step) {
+        Status status = currentStatus.get();
+        if (status != Status.RUNNING) {
+            CompletableFuture<Void> res = new CompletableFuture<>();
+            res.completeExceptionally(new IllegalStateException("Cannot begin: status is " + status));
+            return res;
+        }
+

Review Comment:
   Would you mind adding a test case somewhere in https://github.com/apache/camel/blob/main/core/camel-core/src/test/java/org/apache/camel/processor to prove that it fixes the bug?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng merged pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng merged PR #9344:
URL: https://github.com/apache/camel/pull/9344


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432790368

   Thanks @essobedo for reviewing. In term of saga doc, we have opened a discussion on [narayana zulip](https://narayana.zulipchat.com/#narrow/stream/323714-users/topic/Saga.20timeout.20value.20depend.20on.20what.20.3F) and there is also a tiny configuation issue with `camel-lra-starter`, I just raised https://github.com/apache/camel-spring-boot/pull/752. I'd like to fix the doc issue in a seperated PR and maybe @chen19980 can help us.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432947564

   I still believe that the way timeouts are managed when set on saga participants, doesn't seem to be correct as they should only apply to the participant itself while for now, it affects the whole saga, but maybe it can be done in different PR. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] chen19980 commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "chen19980 (via GitHub)" <gi...@apache.org>.
chen19980 commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1432854930

   @zhfeng Yes, I can help to fix the doc about saga timeout description.But how do I edit or fix this issue ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] essobedo commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "essobedo (via GitHub)" <gi...@apache.org>.
essobedo commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108061851


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);
+
+        MockEndpoint complete = getMockEndpoint("mock:complete");
+        complete.expectedMessageCount(2);

Review Comment:
   That should be `0` since the Saga participants are compensated none can be completed. The participants cannot be both completed and compensated.



##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -81,6 +110,29 @@ public void configure() throws Exception {
                         .compensation("mock:compensate").completion("mock:complete")
                         .to("mock:end");
 
+                from("direct:saga-multi-participants")
+                        .process(exchange -> {
+                            exchange.getMessage().setHeader("id", UUID.randomUUID().toString());
+                        })
+                        .saga()
+                        .propagation(SagaPropagation.REQUIRES_NEW)
+                        .to("direct:service1")
+                        .to("direct:service2");
+
+                from("direct:service1")
+                        .saga().option("id", header("id"))
+                        .propagation(SagaPropagation.MANDATORY).timeout(100, TimeUnit.MILLISECONDS)
+                        .compensation("mock:compensate").completion("mock:complete")
+                        .process(exchange -> {
+                            Thread.sleep(300L, 0);
+                        })

Review Comment:
   You could use the `delay` EIP instead https://camel.apache.org/components/3.20.x/eips/delay-eip.html



##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);

Review Comment:
   That should be `2`, when a timeout expires all participants should be compensated



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1434261423

   It runs the `coreTest` but it looks ilke does not fail the build.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108346789


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -81,6 +110,29 @@ public void configure() throws Exception {
                         .compensation("mock:compensate").completion("mock:complete")
                         .to("mock:end");
 
+                from("direct:saga-multi-participants")
+                        .process(exchange -> {
+                            exchange.getMessage().setHeader("id", UUID.randomUUID().toString());
+                        })
+                        .saga()
+                        .propagation(SagaPropagation.REQUIRES_NEW)
+                        .to("direct:service1")
+                        .to("direct:service2");
+
+                from("direct:service1")
+                        .saga().option("id", header("id"))
+                        .propagation(SagaPropagation.MANDATORY).timeout(100, TimeUnit.MILLISECONDS)
+                        .compensation("mock:compensate").completion("mock:complete")
+                        .process(exchange -> {
+                            Thread.sleep(300L, 0);
+                        })

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] zhfeng commented on a diff in pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "zhfeng (via GitHub)" <gi...@apache.org>.
zhfeng commented on code in PR #9344:
URL: https://github.com/apache/camel/pull/9344#discussion_r1108347116


##########
core/camel-core/src/test/java/org/apache/camel/processor/SagaTimeoutTest.java:
##########
@@ -64,6 +70,29 @@ public void testTimeoutHasNoEffectIfCompleted() throws Exception {
         compensate.assertIsNotSatisfied();
     }
 
+    @Test
+    public void testTimeoutMultiParticipants() throws Exception {
+
+        MockEndpoint compensate = getMockEndpoint("mock:compensate");
+        compensate.expectedMessageCount(1);
+
+        MockEndpoint complete = getMockEndpoint("mock:complete");
+        complete.expectedMessageCount(2);

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1429229153

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9344: CAMEL-19031: Check current saga status is RUNNING before add a step

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9344:
URL: https://github.com/apache/camel/pull/9344#issuecomment-1429294798

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org