camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r936213 - in /camel/trunk: components/camel-http/src/main/java/org/apache/camel/component/http/ components/camel-jetty/src/main/java/org/apache/camel/component/jetty/ components/camel-jetty/src/test/java/org/apache/camel/component/jetty/ te...
Date Wed, 21 Apr 2010 09:07:24 GMT
Author: davsclaus
Date: Wed Apr 21 09:07:24 2010
New Revision: 936213

URL: http://svn.apache.org/viewvc?rev=936213&view=rev
Log:
CAMEL-2660: camel-jetty can now be suspended. Also it will return a http stats 503 when suspended,
and it support better graceful shutdown by letting inflight run to completion, and return
503 for new incoming requests.

Added:
    camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
  (with props)
    camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
  (with props)
    camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
  (with props)
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest.java
      - copied, changed from r936153, camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java
    camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest-context.xml
      - copied, changed from r936153, camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownTest-context.xml
Modified:
    camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
    camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
    camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
    camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java

Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java?rev=936213&r1=936212&r2=936213&view=diff
==============================================================================
--- camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
(original)
+++ camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
Wed Apr 21 09:07:24 2010
@@ -47,6 +47,12 @@ public class CamelServlet extends HttpSe
                 return;
             }
 
+            // are we suspended?
+            if (consumer.isSuspended()) {
+                response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
+                return;
+            }
+
             // Have the camel process the HTTP exchange.
             DefaultExchange exchange = new DefaultExchange(consumer.getEndpoint(), ExchangePattern.InOut);
             exchange.setIn(new HttpMessage(exchange, request, response));

Modified: camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java?rev=936213&r1=936212&r2=936213&view=diff
==============================================================================
--- camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
(original)
+++ camel/trunk/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
Wed Apr 21 09:07:24 2010
@@ -17,14 +17,15 @@
 package org.apache.camel.component.http;
 
 import org.apache.camel.Processor;
+import org.apache.camel.SuspendableService;
 import org.apache.camel.impl.DefaultConsumer;
 
 /**
  * @version $Revision$
  */
-public class HttpConsumer extends DefaultConsumer {
-
+public class HttpConsumer extends DefaultConsumer implements SuspendableService {
     private final HttpEndpoint endpoint;
+    private volatile boolean suspended;
 
     public HttpConsumer(HttpEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
@@ -55,4 +56,17 @@ public class HttpConsumer extends Defaul
         endpoint.disconnect(this);
         super.doStop();
     }
+
+    public void suspend() {
+        suspended = true;
+    }
+
+    public void resume() {
+        suspended = false;
+    }
+
+    public boolean isSuspended() {
+        return suspended;
+    }
+
 }

Modified: camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java?rev=936213&r1=936212&r2=936213&view=diff
==============================================================================
--- camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
(original)
+++ camel/trunk/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java
Wed Apr 21 09:07:24 2010
@@ -104,16 +104,7 @@ public class JettyHttpComponent extends 
             return --refCount;
         }
     }
-    
-    public void setEnableJmx(boolean enableJmx) {
-        this.enableJmx = enableJmx;
-    }
-    
-    public boolean isEnableJmx() {
-        return enableJmx;
-    }
-    
-    
+
     @Override
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
         uri = uri.startsWith("jetty:") ? remaining : uri;
@@ -421,6 +412,14 @@ public class JettyHttpComponent extends 
         this.httpClientMaxThreads = httpClientMaxThreads;
     }
 
+    public void setEnableJmx(boolean enableJmx) {
+        this.enableJmx = enableJmx;
+    }
+
+    public boolean isEnableJmx() {
+        return enableJmx;
+    }
+
     public synchronized MBeanContainer getMbContainer() {
         // If null, provide the default implementation.
         if (mbContainer == null) {

Added: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java?rev=936213&view=auto
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
(added)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
Wed Apr 21 09:07:24 2010
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty;
+
+import java.net.ConnectException;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.http.HttpConsumer;
+import org.apache.camel.component.http.HttpOperationFailedException;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * @version $Revision$
+ */
+public class JettySuspendResumeTest extends CamelTestSupport {
+
+    private String serverUri = "http://localhost:9186/cool";
+
+    @Test
+    public void testJettySuspendResume() throws Exception {
+        context.getShutdownStrategy().setTimeout(50);
+        
+        String reply = template.requestBody(serverUri, "World", String.class);
+        assertEquals("Bye World", reply);
+
+        // now suspend jetty
+        HttpConsumer consumer = (HttpConsumer) context.getRoute("route1").getConsumer();
+        assertNotNull(consumer);
+
+        // suspend
+        consumer.suspend();
+
+        try {
+            template.requestBody(serverUri, "Moon", String.class);
+            fail("Should throw exception");
+        } catch (Exception e) {
+            HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class,
e.getCause());
+            assertEquals(503, cause.getStatusCode());
+        }
+
+        // resume
+        consumer.resume();
+
+        // and send request which should be processed
+        reply = template.requestBody(serverUri, "Moon", String.class);
+        assertEquals("Bye Moon", reply);
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("jetty://" + serverUri)
+                    .transform(body().prepend("Bye "));
+            }
+        };
+    }
+}

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendResumeTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java?rev=936213&view=auto
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
(added)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
Wed Apr 21 09:07:24 2010
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty;
+
+import java.net.ConnectException;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.http.HttpConsumer;
+import org.apache.camel.component.http.HttpOperationFailedException;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * @version $Revision$
+ */
+public class JettySuspendTest extends CamelTestSupport {
+
+    private String serverUri = "http://localhost:9187/cool";
+
+    @Test
+    public void testJettySuspend() throws Exception {
+        context.getShutdownStrategy().setTimeout(50);
+
+        String reply = template.requestBody(serverUri, "World", String.class);
+        assertEquals("Bye World", reply);
+
+        // now suspend jetty
+        HttpConsumer consumer = (HttpConsumer) context.getRoute("route1").getConsumer();
+        assertNotNull(consumer);
+
+        // suspend
+        consumer.suspend();
+
+        try {
+            template.requestBody(serverUri, "Moon", String.class);
+            fail("Should throw exception");
+        } catch (Exception e) {
+            HttpOperationFailedException cause = assertIsInstanceOf(HttpOperationFailedException.class,
e.getCause());
+            assertEquals(503, cause.getStatusCode());
+        }
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("jetty://" + serverUri)
+                    .transform(body().prepend("Bye "));
+            }
+        };
+    }
+}

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java?rev=936213&view=auto
==============================================================================
--- camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
(added)
+++ camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
Wed Apr 21 09:07:24 2010
@@ -0,0 +1,88 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.http.HttpOperationFailedException;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+import static org.apache.camel.language.simple.SimpleLanguage.simple;
+
+/**
+ * @version $Revision$
+ */
+public class JettySuspendWhileInProgressTest extends CamelTestSupport {
+
+    private String serverUri = "http://localhost:9185/cool";
+
+    @Test
+    public void testJettySuspendWhileInProgress() throws Exception {
+        context.getShutdownStrategy().setTimeout(50);
+
+        // send a request/reply and have future handle so we can shutdown while in progress
+        Future<String> reply = template.asyncRequestBodyAndHeader(serverUri, null,
"name", "Camel", String.class);
+
+        // shutdown camel while in progress, wait 2 sec so the first req has been received
in Camel route
+        Executors.newSingleThreadExecutor().execute(new Runnable() {
+            public void run() {
+                try {
+                    Thread.sleep(2000);
+                    JettySuspendWhileInProgressTest.this.context.stop();
+                } catch (Exception e) {
+                    // ignore
+                }
+            }
+        });
+
+        // wait a bit more before sending next
+        Thread.sleep(5000);
+
+        // now send a new req/reply
+        Future<String> reply2 = template.asyncRequestBodyAndHeader(serverUri, null,
"name", "Tiger", String.class);
+
+        // the first should wait to have its reply returned
+        assertEquals("Bye Camel", reply.get(20, TimeUnit.SECONDS));
+
+        // the 2nd should have a 503 returned as we are shutting down
+        try {
+            reply2.get(20, TimeUnit.SECONDS);
+           fail("Should throw exception");
+        } catch (Exception e) {
+            RuntimeCamelException rce = assertIsInstanceOf(RuntimeCamelException.class, e.getCause());
+            HttpOperationFailedException hofe = assertIsInstanceOf(HttpOperationFailedException.class,
rce.getCause());
+            assertEquals(503, hofe.getStatusCode());
+        }
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                from("jetty://" + serverUri)
+                    .log("Got data will wait 10 sec with reply")
+                    .delay(10000)
+                    .transform(simple("Bye ${header.name}"));
+            }
+        };
+    }
+}

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettySuspendWhileInProgressTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Copied: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest.java
(from r936153, camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest.java?p2=camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest.java&p1=camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java&r1=936153&r2=936213&rev=936213&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java
(original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest.java
Wed Apr 21 09:07:24 2010
@@ -16,19 +16,22 @@
  */
 package org.apache.camel.itest.jetty;
 
+import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 
 import junit.framework.Assert;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.component.http.HttpOperationFailedException;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
 
 @ContextConfiguration
-public class JettyJmsShutdownTest extends AbstractJUnit4SpringContextTests {
+public class JettyJmsShutdownInProgressTest extends AbstractJUnit4SpringContextTests {
 
     @Autowired
     protected CamelContext camelContext;
@@ -37,19 +40,37 @@ public class JettyJmsShutdownTest extend
     protected ProducerTemplate template;
 
     @Test
-    public void testShutdown() throws Exception {
-        Future<String> reply1 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"World", String.class);
-        Future<String> reply2 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"Camel", String.class);
-        Future<String> reply3 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"Tiger", String.class);
-
-        Thread.sleep(1000);
-
-        // shutdown while in progress
-        camelContext.stop();
-
-        Assert.assertEquals("Bye World", reply1.get(5, TimeUnit.SECONDS));
-        Assert.assertEquals("Bye Camel", reply2.get(5, TimeUnit.SECONDS));
-        Assert.assertEquals("Bye Tiger", reply3.get(5, TimeUnit.SECONDS));
+    public void testShutdownInProgress() throws Exception {
+        Future<String> reply1 = template.asyncRequestBody("http://localhost:9002/test",
"World", String.class);
+        Future<String> reply2 = template.asyncRequestBody("http://localhost:9002/test",
"Camel", String.class);
+
+        // shutdown camel while in progress, wait 2 sec so the first req has been received
in Camel route
+        Executors.newSingleThreadExecutor().execute(new Runnable() {
+            public void run() {
+                try {
+                    Thread.sleep(2000);
+                    JettyJmsShutdownInProgressTest.this.camelContext.stop();
+                } catch (Exception e) {
+                    // ignore
+                }
+            }
+        });
+
+        // wait a bit more before sending next
+        Thread.sleep(5000);
+
+        // this one should fail
+        try {
+            template.requestBody("http://localhost:9002/test", "Tiger", String.class);
+            Assert.fail("Should have thrown exception");
+        } catch (Exception e) {
+            HttpOperationFailedException hofe = (HttpOperationFailedException) e.getCause();
+            Assert.assertEquals(503, hofe.getStatusCode());
+        }
+
+        // but the 2 first should still return valid replies
+        Assert.assertEquals("Bye World", reply1.get(10, TimeUnit.SECONDS));
+        Assert.assertEquals("Bye Camel", reply2.get(10, TimeUnit.SECONDS));
     }
 
 }
\ No newline at end of file

Modified: camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java?rev=936213&r1=936212&r2=936213&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java
(original)
+++ camel/trunk/tests/camel-itest/src/test/java/org/apache/camel/itest/jetty/JettyJmsShutdownTest.java
Wed Apr 21 09:07:24 2010
@@ -38,9 +38,9 @@ public class JettyJmsShutdownTest extend
 
     @Test
     public void testShutdown() throws Exception {
-        Future<String> reply1 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"World", String.class);
-        Future<String> reply2 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"Camel", String.class);
-        Future<String> reply3 = template.asyncRequestBody("jetty:http://localhost:9000/test",
"Tiger", String.class);
+        Future<String> reply1 = template.asyncRequestBody("http://localhost:9000/test",
"World", String.class);
+        Future<String> reply2 = template.asyncRequestBody("http://localhost:9000/test",
"Camel", String.class);
+        Future<String> reply3 = template.asyncRequestBody("http://localhost:9000/test",
"Tiger", String.class);
 
         Thread.sleep(1000);
 

Copied: camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest-context.xml
(from r936153, camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownTest-context.xml)
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest-context.xml?p2=camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest-context.xml&p1=camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownTest-context.xml&r1=936153&r2=936213&rev=936213&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownTest-context.xml
(original)
+++ camel/trunk/tests/camel-itest/src/test/resources/org/apache/camel/itest/jetty/JettyJmsShutdownInProgressTest-context.xml
Wed Apr 21 09:07:24 2010
@@ -28,9 +28,9 @@
 
     <camelContext xmlns="http://camel.apache.org/schema/spring">
 
-        <!-- defer shutdown to route the in progress exchanges -->
-        <route shutdownRoute="Defer">
-            <from uri="jetty:http://localhost:9000/test"/>
+        <!-- jetty supports suspension so we can graceful shutdown -->
+        <route>
+            <from uri="jetty:http://localhost:9002/test"/>
             <to uri="jms:queue:foo"/>
         </route>
 
@@ -38,7 +38,7 @@
         <route shutdownRoute="Defer">
             <from uri="jms:queue:foo?concurrentConsumers=5"/>
             <delay>
-                <constant>5000</constant>
+                <constant>10000</constant>
             </delay>
             <transform>
                 <simple>Bye ${body}</simple>



Mime
View raw message