oscerd commented on code in PR #28560:
URL: https://github.com/apache/camel/pull/28560#discussion_r4389624323


##########
components/camel-lra/src/main/java/org/apache/camel/service/lra/LRASagaService.java:
##########
@@ -90,7 +91,17 @@ public LRASagaService() {
     @Override
     public CompletableFuture<CamelSagaCoordinator> newSaga(Exchange exchange) {
         return client.newLRA(exchange)
-                .thenApply(url -> new LRASagaCoordinator(LRASagaService.this, 
url));
+                .thenApply(url -> {
+                    URI lra = toUri(url);
+                    if (lra == null || !isHostedByAllowedCoordinator(lra)) {

Review Comment:
   Added a code comment clarifying that the LRA is deliberately not cancelled 
through the unapproved URL to avoid connecting to the rejected destination.
   
   _Claude Code on behalf of oscerd_



##########
components/camel-lra/src/test/java/org/apache/camel/service/lra/LRASagaServiceTest.java:
##########
@@ -75,6 +78,86 @@ void testCallsClientWithExchange() throws Exception {
         Mockito.verify(client).newLRA(exchange);
     }
 
+    @DisplayName("Tests whether newSaga(Exchange) accepts an LRA hosted by the 
configured coordinator")
+    @Test
+    void testNewSagaAcceptsAllowedCoordinatorUrl() throws Exception {

Review Comment:
   Done, extracted the common setup to a `startedService` helper method.
   
   _Claude Code on behalf of oscerd_



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to