You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/06/14 13:09:16 UTC

[camel] 01/01: CAMEL-12577: Re-apply CAMEL-12104 Unintuitive default cxf timeout behavior

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 007fded40fcf5108d75b5ffc32789d7c3dc5ca66
Author: Peter Palaga <pp...@redhat.com>
AuthorDate: Thu Jun 14 11:32:16 2018 +0200

    CAMEL-12577: Re-apply CAMEL-12104 Unintuitive default cxf timeout
    behavior
---
 .../src/main/java/org/apache/camel/component/cxf/CxfConsumer.java    | 5 +++--
 .../main/java/org/apache/camel/component/cxf/jaxrs/CxfRsInvoker.java | 4 ++--
 .../camel/component/cxf/CxfConsumerContinuationTimeoutTest.java      | 2 --
 3 files changed, 5 insertions(+), 6 deletions(-)

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 3ba12bf..95705c7 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
@@ -191,7 +191,7 @@ public class CxfConsumer extends DefaultConsumer {
                         }
                     });
 
-                } else if (continuation.isResumed()) {
+                } else if (!continuation.isTimeout() && continuation.isResumed()) {
                     org.apache.camel.Exchange camelExchange = (org.apache.camel.Exchange)continuation.getObject();
                     try {
                         setResponseBack(cxfExchange, camelExchange);
@@ -199,7 +199,8 @@ public class CxfConsumer extends DefaultConsumer {
                         CxfConsumer.this.doneUoW(camelExchange);
                         throw ex;
                     }
-                } else if (!continuation.isResumed() && !continuation.isPending()) {
+
+                } else if (continuation.isTimeout() || (!continuation.isResumed() && !continuation.isPending())) {
                     org.apache.camel.Exchange camelExchange = (org.apache.camel.Exchange)continuation.getObject();
                     try {
                         if (!continuation.isPending()) {
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 29d9fa3..fef3818 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 class CxfRsInvoker extends JAXRSInvoker {
                 });
                 return null;
             }
-            if (continuation.isResumed()) {
+            if (!continuation.isTimeout() && continuation.isResumed()) {
                 cxfExchange.put(SUSPENED, Boolean.FALSE);
                 org.apache.camel.Exchange camelExchange = (org.apache.camel.Exchange)continuation.getObject();
                 try {
@@ -114,7 +114,7 @@ public class CxfRsInvoker extends JAXRSInvoker {
                     throw ex;
                 }
             } else {
-                if (!continuation.isPending()) {
+                if (continuation.isTimeout() || !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 cfe31bd..d628501 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,7 +25,6 @@ import org.apache.camel.Message;
 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 {
@@ -114,7 +113,6 @@ public class CxfConsumerContinuationTimeoutTest extends CamelTestSupport {
     }
 
     @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."));

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