[ 
https://issues.apache.org/jira/browse/CAMEL-12409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415119#comment-16415119
 ] 

ASF GitHub Bot commented on CAMEL-12409:
----------------------------------------

davsclaus closed pull request #2271: CAMEL-12409 Temporary revert CAMEL-12104 
Unintuitive default cxf timeout
URL: https://github.com/apache/camel/pull/2271
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
index 3f5bc8794b7..7dd3f4cde2b 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
@@ -52,11 +52,11 @@
 
 /**
  * A Consumer of exchanges for a service in CXF.  CxfConsumer acts a CXF
- * service to receive requests, convert them, and forward them to Camel 
+ * service to receive requests, convert them, and forward them to Camel
  * route for processing. It is also responsible for converting and sending
  * back responses to CXF client.
  *
- * @version 
+ * @version
  */
 public class CxfConsumer extends DefaultConsumer {
     private static final Logger LOG = 
LoggerFactory.getLogger(CxfConsumer.class);
@@ -150,19 +150,19 @@ private EndpointReferenceType getReplyTo(Object o) {
     protected boolean isAsyncInvocationSupported(Exchange cxfExchange) {
         Message cxfMessage = cxfExchange.getInMessage();
         Object addressingProperties = 
cxfMessage.get(CxfConstants.WSA_HEADERS_INBOUND);
-        if (addressingProperties != null 
+        if (addressingProperties != null
                && 
!ContextUtils.isGenericAddress(getReplyTo(addressingProperties))) {
             //it's decoupled endpoint, so already switch thread and
-            //use executors, which means underlying transport won't 
-            //be block, so we shouldn't rely on continuation in 
-            //this case, as the SuspendedInvocationException can't be 
+            //use executors, which means underlying transport won't
+            //be block, so we shouldn't rely on continuation in
+            //this case, as the SuspendedInvocationException can't be
             //caught by underlying transport. So we should use the 
SyncInvocation this time
             return false;
         }
         // we assume it should support AsyncInvocation out of box
         return true;
     }
-    
+
     private class CxfConsumerInvoker implements Invoker {
         private final CxfEndpoint endpoint;
 
@@ -197,7 +197,7 @@ private Object asyncInvoke(Exchange cxfExchange, final 
Continuation continuation
 
                     // The continuation could be called before the suspend is 
called
                     continuation.suspend(cxfEndpoint.getContinuationTimeout());
-                    
+
                     continuation.setObject(camelExchange);
 
                     // use the asynchronous API to process the exchange
@@ -212,7 +212,7 @@ public void done(boolean doneSync) {
                         }
                     });
 
-                } else if (!continuation.isTimeout() && 
continuation.isResumed()) {
+                } else if (continuation.isResumed()) {
                     org.apache.camel.Exchange camelExchange = 
(org.apache.camel.Exchange)continuation.getObject();
                     try {
                         setResponseBack(cxfExchange, camelExchange);
@@ -220,8 +220,7 @@ public void done(boolean doneSync) {
                         CxfConsumer.this.doneUoW(camelExchange);
                         throw ex;
                     }
-
-                } else if (continuation.isTimeout() || 
(!continuation.isResumed() && !continuation.isPending())) {
+                } else if (!continuation.isResumed() && 
!continuation.isPending()) {
                     org.apache.camel.Exchange camelExchange = 
(org.apache.camel.Exchange)continuation.getObject();
                     try {
                         if (!continuation.isPending()) {
@@ -234,7 +233,6 @@ public void done(boolean doneSync) {
                     }
                 }
             }
-            
             return null;
         }
 
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsInvoker.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsInvoker.java
index fef3818f43a..29d9fa3eb90 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsInvoker.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsInvoker.java
@@ -104,7 +104,7 @@ public void done(boolean doneSync) {
                 });
                 return null;
             }
-            if (!continuation.isTimeout() && continuation.isResumed()) {
+            if (continuation.isResumed()) {
                 cxfExchange.put(SUSPENED, Boolean.FALSE);
                 org.apache.camel.Exchange camelExchange = 
(org.apache.camel.Exchange)continuation.getObject();
                 try {
@@ -114,7 +114,7 @@ public void done(boolean doneSync) {
                     throw ex;
                 }
             } else {
-                if (continuation.isTimeout() || !continuation.isPending()) {
+                if (!continuation.isPending()) {
                     cxfExchange.put(SUSPENED, Boolean.FALSE);
                     org.apache.camel.Exchange camelExchange = 
(org.apache.camel.Exchange)continuation.getObject();
                     camelExchange.setException(new 
ExchangeTimedOutException(camelExchange, endpoint.getContinuationTimeout()));
diff --git 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerContinuationTimeoutTest.java
 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerContinuationTimeoutTest.java
index d628501ddb3..cfe31bde6e5 100644
--- 
a/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerContinuationTimeoutTest.java
+++ 
b/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerContinuationTimeoutTest.java
@@ -25,6 +25,7 @@
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.apache.camel.util.AsyncProcessorHelper;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class CxfConsumerContinuationTimeoutTest extends CamelTestSupport {
@@ -113,6 +114,7 @@ public void testNoTimeout() throws Exception {
     }
 
     @Test
+    @Ignore("CAMEL-12104")
     public void testTimeout() throws Exception {
         String out = template.requestBodyAndHeader("direct:start", "Bye 
World", "priority", "slow", String.class);
         assertTrue(out.contains("The OUT message was not received within: 5000 
millis."));


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Temporary revert CAMEL-12104 Unintuitive default cxf timeout behavior
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-12409
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12409
>             Project: Camel
>          Issue Type: Task
>          Components: camel-cxf
>            Reporter: Claus Ibsen
>            Assignee: Peter Palaga
>            Priority: Major
>             Fix For: 2.22.0
>
>
> There is a problem with some Camel related projects that follow master branch 
> that cannot upgrade to CXF 3.2.4 at this time. We can therefore temporary go 
> back to avoid using the new isTimeout API on CXF 3.2.3 onwards, and then add 
> this back to camel-cxf  when twe are getting closed down for Camel 2.22 
> release.
> There was an API change in CXF 3.2.3 onwards started by CAMEL-12104



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to