Author: davsclaus
Date: Sat Nov 21 10:06:23 2009
New Revision: 882870

URL: http://svn.apache.org/viewvc?rev=882870&view=rev
Log:
CAMEL-2108: Fixed transacted routes mixed with Camel error handling doing 
redelivery from the beginning of the route and not only at the failed node in 
the route path. RedeliveryErrorHandler is now part of TransactionalErrorHandler 
hence the isTransacted check should be removed.

Added:
    
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
   (with props)
    
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
   (with props)
    
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
   (with props)
    
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml
      - copied, changed from r882834, 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
    
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
   (with props)
    
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
   (with props)
Modified:
    
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
    camel/trunk/components/camel-jms/src/test/resources/log4j.properties

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java?rev=882870&r1=882869&r2=882870&view=diff
==============================================================================
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/RedeliveryErrorHandler.java
 Sat Nov 21 10:06:23 2009
@@ -101,15 +101,6 @@
                 return;
             }
 
-            // do not handle transacted exchanges that failed as this error 
handler does not support it
-            if (exchange.isTransacted() && !supportTransacted() && 
exchange.getException() != null) {
-                if (log.isTraceEnabled()) {
-                    log.trace("This error handler does not support transacted 
exchanges."
-                        + " Bypassing this error handler: " + this + " for 
exchangeId: " + exchange.getExchangeId());
-                }
-                return;
-            }
-
             // did previous processing cause an exception?
             boolean handle = shouldHandleException(exchange);
             if (handle) {

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java?rev=882870&r1=882869&r2=882870&view=diff
==============================================================================
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java 
(original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/util/ObjectHelper.java 
Sat Nov 21 10:06:23 2009
@@ -76,7 +76,7 @@
 
         if (leftValue == null || rightValue == null) {
             // no reason to continue as the first equal did not match and now 
one of the values is null
-            // so it wont help to type coerece to a null type
+            // so it wont help to type coerce to a null type
             return false;
         }
 

Added: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java?rev=882870&view=auto
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
 Sat Nov 21 10:06:23 2009
@@ -0,0 +1,119 @@
+/**
+ * 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.jms.tx;
+
+import org.apache.camel.Body;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Handler;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.SpringRouteBuilder;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class JMXTXUseOriginalBodyTest extends CamelSpringTestSupport {
+
+    @EndpointInject(uri = "mock:end")
+    protected MockEndpoint endpoint;
+
+    @EndpointInject(uri = "mock:error")
+    protected MockEndpoint error;
+
+    @EndpointInject(uri = "mock:checkpoint1")
+    protected MockEndpoint checkpoint1;
+
+    @EndpointInject(uri = "mock:checkpoint2")
+    protected MockEndpoint checkpoint2;
+
+    @Produce(uri = "activemq:start")
+    protected ProducerTemplate start;
+
+    @Produce(uri = "activemq:broken")
+    protected ProducerTemplate broken;
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml");
+    }
+
+    @Test
+    public void testWithConstant() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        start.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testWithBean() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        broken.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    public static class FooBean {
+        @Handler
+        public String process(@Body String body) {
+            return "oh no";
+        }
+    }
+
+
+    public static class TestRoutes extends SpringRouteBuilder {
+
+        @Override
+        public void configure() throws Exception {
+            onException(Exception.class)
+                    .handled(true)
+                    .useOriginalBody()
+                    .maximumRedeliveries(2)
+                    .to("mock:error");
+
+            from("activemq:broken")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(bean("foo"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+            from("activemq:start")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(constant("oh no"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+        }
+    }
+}

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java?rev=882870&view=auto
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
 Sat Nov 21 10:06:23 2009
@@ -0,0 +1,149 @@
+/**
+ * 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.jms.tx;
+
+import org.apache.camel.Body;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Handler;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.SpringRouteBuilder;
+import org.junit.Test;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class JMXTXUseOriginalBodyWithDLCErrorHandlerTest extends 
JMXTXUseOriginalBodyTest {
+
+    @EndpointInject(uri = "mock:end")
+    protected MockEndpoint endpoint;
+
+    @EndpointInject(uri = "mock:error")
+    protected MockEndpoint error;
+
+    @EndpointInject(uri = "mock:dead")
+    protected MockEndpoint dead;
+
+    @EndpointInject(uri = "mock:checkpoint1")
+    protected MockEndpoint checkpoint1;
+
+    @EndpointInject(uri = "mock:checkpoint2")
+    protected MockEndpoint checkpoint2;
+
+    @Produce(uri = "activemq:start")
+    protected ProducerTemplate start;
+
+    @Produce(uri = "activemq:broken")
+    protected ProducerTemplate broken;
+
+    @Produce(uri = "activemq:ok")
+    protected ProducerTemplate ok;
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml");
+    }
+
+    @Test
+    public void testWithConstant() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        dead.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        start.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testWithBean() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        dead.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        broken.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testOk() throws InterruptedException {
+        endpoint.expectedMessageCount(1);
+        dead.expectedMessageCount(0);
+        error.expectedMessageCount(0);
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        ok.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    public static class FooBean {
+        @Handler
+        public String process(@Body String body) {
+            return "oh no";
+        }
+    }
+
+
+    public static class TestRoutes extends SpringRouteBuilder {
+
+        @Override
+        public void configure() throws Exception {
+            
errorHandler(deadLetterChannel("mock:dead").maximumRedeliveries(5));
+
+            onException(Exception.class)
+                    .handled(true)
+                    .useOriginalBody()
+                    .redeliverDelay(0)
+                    .maximumRedeliveries(2)
+                    .to("mock:error");
+
+            from("activemq:broken")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(bean("foo"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+            from("activemq:start")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(constant("oh no"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+            from("activemq:ok")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(constant("oh no"))
+                    .to("mock:checkpoint2")
+                    .to("mock:end");
+
+        }
+    }
+}
\ No newline at end of file

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java?rev=882870&view=auto
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
 Sat Nov 21 10:06:23 2009
@@ -0,0 +1,121 @@
+/**
+ * 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.jms.tx;
+
+import org.apache.camel.Body;
+import org.apache.camel.EndpointInject;
+import org.apache.camel.Handler;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.spring.SpringRouteBuilder;
+import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.junit.Test;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version $Revision$
+ */
+public class JMXTXUseOriginalBodyWithTXErrorHandlerTest extends 
JMXTXUseOriginalBodyTest {
+
+    @EndpointInject(uri = "mock:end")
+    protected MockEndpoint endpoint;
+
+    @EndpointInject(uri = "mock:error")
+    protected MockEndpoint error;
+
+    @EndpointInject(uri = "mock:checkpoint1")
+    protected MockEndpoint checkpoint1;
+
+    @EndpointInject(uri = "mock:checkpoint2")
+    protected MockEndpoint checkpoint2;
+
+    @Produce(uri = "activemq:start")
+    protected ProducerTemplate start;
+
+    @Produce(uri = "activemq:broken")
+    protected ProducerTemplate broken;
+
+    @Override
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new 
ClassPathXmlApplicationContext("/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml");
+    }
+
+    @Test
+    public void testWithConstant() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        start.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testWithBean() throws InterruptedException {
+        endpoint.expectedMessageCount(0);
+        error.expectedBodiesReceived("foo");
+        checkpoint1.expectedBodiesReceived("foo");
+        checkpoint2.expectedBodiesReceived("oh no");
+
+        broken.sendBody("foo");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    public static class FooBean {
+        @Handler
+        public String process(@Body String body) {
+            return "oh no";
+        }
+    }
+
+
+    public static class TestRoutes extends SpringRouteBuilder {
+
+        @Override
+        public void configure() throws Exception {
+            errorHandler(transactionErrorHandler());
+
+            onException(Exception.class)
+                    .handled(true)
+                    .useOriginalBody()
+                    .maximumRedeliveries(2)
+                    .to("mock:error");
+
+            from("activemq:broken")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(bean("foo"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+            from("activemq:start")
+                    .transacted()
+                    .to("mock:checkpoint1")
+                    .setBody(constant("oh no"))
+                    .to("mock:checkpoint2")
+                    .throwException(new Exception("boo"))
+                    .to("mock:end");
+
+        }
+    }
+}
\ No newline at end of file

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: camel/trunk/components/camel-jms/src/test/resources/log4j.properties
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/log4j.properties?rev=882870&r1=882869&r2=882870&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/resources/log4j.properties 
(original)
+++ camel/trunk/components/camel-jms/src/test/resources/log4j.properties Sat 
Nov 21 10:06:23 2009
@@ -32,6 +32,9 @@
 log4j.appender.out.file=target/camel-jms-test.log
 log4j.appender.out.append=true
 
+log4j.logger.org.apache.camel.impl.converter=WARN
+log4j.logger.org.apache.camel.management=WARN
+log4j.logger.org.apache.camel.impl.DefaultPackageScanClassResolver=WARN
 #log4j.logger.org.apache.activemq.spring=WARN
 #log4j.logger.org.apache.camel.component.jms=TRACE
-#log4j.logger.org.apache.camel=DEBUG
\ No newline at end of file
+#log4j.logger.org.apache.camel=DEBUG

Copied: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml
 (from r882834, 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml)
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml?p2=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml&p1=camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml&r1=882834&r2=882870&rev=882870&view=diff
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/TransactionMinimalConfigurationTest.xml
 (original)
+++ 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyTest.xml
 Sat Nov 21 10:06:23 2009
@@ -22,45 +22,26 @@
          http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
          http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
 
-    <!-- START SNIPPET: e1 -->
-    <!-- setup JMS connection factory -->
     <bean id="jmsConnectionFactory" 
class="org.apache.activemq.ActiveMQConnectionFactory">
         <property name="brokerURL" 
value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
     </bean>
 
-    <!-- setup spring jms TX manager -->
     <bean id="jmsTransactionManager" 
class="org.springframework.jms.connection.JmsTransactionManager">
         <property name="connectionFactory" ref="jmsConnectionFactory"/>
     </bean>
 
-    <!-- define our activemq component -->
     <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent">
         <property name="connectionFactory" ref="jmsConnectionFactory"/>
-        <!-- define the jms consumer/producer as transacted -->
         <property name="transacted" value="true"/>
-        <!-- setup the transaction manager to use -->
-        <!-- if not provided then Camel will automatic use a 
JmsTransactionManager, however if you
-             for instance use a JTA transaction manager then you must 
configure it -->
         <property name="transactionManager" ref="jmsTransactionManager"/>
     </bean>
-    <!-- END SNIPPET: e1 -->
 
-    <!-- START SNIPPET: e2 -->
     <camelContext xmlns="http://camel.apache.org/schema/spring";>
-        <route>
-            <!-- 1: from the jms queue -->
-            <from uri="activemq:queue:okay"/>
-            <!-- 2: mark this route as transacted -->
-            <transacted/>
-            <!-- 3: call our business logic that is myProcessor -->
-            <process ref="myProcessor"/>
-            <!-- 4: if success then send it to the mock -->
-            <to uri="mock:result"/>
-        </route>
+        <routeBuilder ref="routes"/>
     </camelContext>
 
-    <bean id="myProcessor" 
class="org.apache.camel.component.jms.tx.JMSTransactionalClientTest$MyProcessor"/>
-    <!-- END SNIPPET: e2 -->
+    <bean id="routes" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyTest$TestRoutes"/>
 
+    <bean id="foo" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyTest$FooBean"/>
 
 </beans>

Added: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml?rev=882870&view=auto
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
 Sat Nov 21 10:06:23 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+         http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+    <bean id="jmsConnectionFactory" 
class="org.apache.activemq.ActiveMQConnectionFactory">
+        <property name="brokerURL" 
value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
+    </bean>
+
+    <bean id="jmsTransactionManager" 
class="org.springframework.jms.connection.JmsTransactionManager">
+        <property name="connectionFactory" ref="jmsConnectionFactory"/>
+    </bean>
+
+    <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent">
+        <property name="connectionFactory" ref="jmsConnectionFactory"/>
+        <property name="transacted" value="true"/>
+        <property name="transactionManager" ref="jmsTransactionManager"/>
+    </bean>
+
+    <camelContext xmlns="http://camel.apache.org/schema/spring";>
+        <routeBuilder ref="routes"/>
+    </camelContext>
+
+    <bean id="routes" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyWithDLCErrorHandlerTest$TestRoutes"/>
+
+    <bean id="foo" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyWithDLCErrorHandlerTest$FooBean"/>
+
+</beans>

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithDLCErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml?rev=882870&view=auto
==============================================================================
--- 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
 (added)
+++ 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
 Sat Nov 21 10:06:23 2009
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans";
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="
+         http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+         http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+    <bean id="jmsConnectionFactory" 
class="org.apache.activemq.ActiveMQConnectionFactory">
+        <property name="brokerURL" 
value="vm://localhost?broker.persistent=false&amp;broker.useJmx=false"/>
+    </bean>
+
+    <bean id="jmsTransactionManager" 
class="org.springframework.jms.connection.JmsTransactionManager">
+        <property name="connectionFactory" ref="jmsConnectionFactory"/>
+    </bean>
+
+    <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent">
+        <property name="connectionFactory" ref="jmsConnectionFactory"/>
+        <property name="transacted" value="true"/>
+        <property name="transactionManager" ref="jmsTransactionManager"/>
+    </bean>
+
+    <camelContext xmlns="http://camel.apache.org/schema/spring";>
+        <routeBuilder ref="routes"/>
+    </camelContext>
+
+    <bean id="routes" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyWithTXErrorHandlerTest$TestRoutes"/>
+
+    <bean id="foo" 
class="org.apache.camel.component.jms.tx.JMXTXUseOriginalBodyWithTXErrorHandlerTest$FooBean"/>
+
+</beans>

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: 
camel/trunk/components/camel-jms/src/test/resources/org/apache/camel/component/jms/tx/JMXTXUseOriginalBodyWithTXErrorHandlerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml


Reply via email to