gnodet-bot commented on code in PR #29876:
URL: https://github.com/apache/camel/pull/29876#discussion_r4565933363


##########
components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java:
##########
@@ -155,6 +156,22 @@ public void testInvokingAWrongServer() throws Exception {
         assertInstanceOf(IOException.class, reply.getException().getCause());
     }
 
+    // CAMEL-26696: async producer must always complete the exchange when the 
connection fails.
+    // The @Timeout(30s) on the class guards against the exchange hanging in
+    // DefaultAsyncProcessorAwaitManager if camelAsyncCallback.done() is never 
called.

Review Comment:
   ⚠️ **Stale comment — `@Timeout` annotation not backported**
   
   This comment states _"The `@Timeout(30s)` on the class guards against the 
exchange hanging"_, but the `@Timeout` annotation from the original PR on 
`main` was not backported (neither the import nor the annotation itself appears 
in this diff). The comment is factually incorrect for this branch.
   
   Either remove the `@Timeout` reference from the comment, or also backport 
the annotation:
   ```java
   @Timeout(value = 30, threadMode = Timeout.ThreadMode.SEPARATE_THREAD)
   ```
   (The impact is lower since `testInvokingAWrongServerAsync` is `@Disabled`, 
but the comment is still misleading for anyone reading the code.)



##########
components/camel-cxf/camel-cxf-soap/src/test/java/org/apache/camel/component/cxf/jaxws/CxfProducerTest.java:
##########
@@ -183,7 +200,20 @@ protected String getJaxwsEndpointUri() {
     }
 
     protected String getWrongEndpointUri() {
-        return "cxf://" + getWrongServerAddress() + 
"?serviceClass=org.apache.camel.component.cxf.jaxws.HelloService";
+        // CAMEL-26600: synchronous=true, as with the CXF async client the 
callback sometimes never completes
+        // when the connection fails, leaving the exchange waiting forever.
+        // The async error path is not covered here; see CxfClientCallbackTest 
and CAMEL-26696.
+        return "cxf://" + getWrongServerAddress()
+               + 
"?serviceClass=org.apache.camel.component.cxf.jaxws.HelloService"
+               + "&cxfConfigurer=#wrongServerConfigurer"

Review Comment:
   ⚠️ **Missing bean registration — runtime failure**
   
   Both `getWrongEndpointUri()` (here) and `getWrongEndpointUriAsync()` (line 
216) reference `#wrongServerConfigurer`, but no corresponding 
`camelContext.getRegistry().bind("wrongServerConfigurer", ...)` is added to 
`setUp()` in this backport.
   
   The original PR on `main` (#29450) adds this registration in `setUp()`. 
Without it, `testInvokingAWrongServer` (which is **not** `@Disabled`) will fail 
at runtime with a Camel bean-resolution error when it tries to look up 
`#wrongServerConfigurer`.
   
   Please add the registration to `setUp()`:
   ```java
   camelContext.getRegistry().bind("wrongServerConfigurer", new 
WrongServerConfigurer());
   ```



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