servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r711215 - in /servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test: java/org/apache/servicemix/camel/ resources/org/apache/servicemix/camel/su8-src/
Date Tue, 04 Nov 2008 09:18:37 GMT
Author: gertv
Date: Tue Nov  4 01:18:37 2008
New Revision: 711215

URL: http://svn.apache.org/viewvc?rev=711215&view=rev
Log:
SM-1673: Improve error handling with servicemix-camel

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su8-src/camel-context.xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java?rev=711215&r1=711214&r2=711215&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/JbiInOnlyWithErrorHandledTrueSpringDSLTest.java
Tue Nov  4 01:18:37 2008
@@ -40,7 +40,6 @@
     private ReceiverComponent receiver;
     private ReceiverComponent deadLetter;
 
-    @Override
     protected void setUp() throws Exception {
         receiver = new ReceiverComponent();
         deadLetter = new ReceiverComponent();
@@ -53,12 +52,13 @@
         InOnly exchange = smxClient.createInOnlyExchange();
         exchange.setEndpoint(jbiContainer.getRegistry().getEndpointsForService(TEST_SERVICE)[0]);
 
-        smxClient.sendSync(exchange);
-
-/* not supported in Camel 1.4    
+        smxClient.send(exchange);
+    
+        exchange = (InOnly) smxClient.receive();
         assertEquals(ExchangeStatus.DONE, exchange.getStatus());
+        
         receiver.getMessageList().assertMessagesReceived(1);
-        deadLetter.getMessageList().assertMessagesReceived(0); */
+        deadLetter.getMessageList().assertMessagesReceived(0); 
     }
 
     @Override

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su8-src/camel-context.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su8-src/camel-context.xml?rev=711215&r1=711214&r2=711215&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su8-src/camel-context.xml
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su8-src/camel-context.xml
Tue Nov  4 01:18:37 2008
@@ -24,34 +24,37 @@
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
        http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
     ">
-    
-    <!-- not supported by Camel 1.4 
-    <bean id="camelTracer" class="org.apache.camel.processor.interceptor.Tracer">
-       <property name="traceExceptions" value="false"/>
-       <property name="traceInterceptors" value="true"/>
-       <property name="logLevel" value="FATAL"/>
-       <property name="logName" value="com.mycompany.messages"/>
-    </bean>
-    -->
-    
 
-  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
+  <camelContext  xmlns="http://activemq.apache.org/camel/schema/spring">
     <route errorHandlerRef="deadLetterErrorHandler">
       <from uri="jbi:service:urn:test:error-handled-true"/>
       <onException>
         <exception>java.lang.NullPointerException</exception>
-            <redeliveryPolicy maximumRedeliveries="0"/>
-            <handled>
-              <constant>true</constant>
-            </handled>
-            <to uri="jbi:service:urn:test:receiver-service?mep=in-only"/>
+        <redeliveryPolicy maximumRedeliveries="0"/>
+        <handled>
+          <constant>true</constant>
+        </handled>
+        <to uri="jbi:service:urn:test:receiver-service?mep=in-only"/>
       </onException>
-      <to uri="jbi:service:urn:test:npe-error-service?mep=in-only"/>
+      <interceptor ref="handleFaultProcessor">
+        <to uri="jbi:service:urn:test:npe-error-service?mep=in-only"/>
+      </interceptor>
     </route>
   </camelContext>
 
   <bean id="deadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
     <property name="defaultDeadLetterEndpointUri" value="jbi:service:urn:test:deadLetter-service?mep=in-only"/>
+    <property name="redeliveryPolicy" ref="redeliveryPolicyConfig" />
+  </bean>
+    
+  <bean id="redeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
+    <property name="maximumRedeliveries" value="3" />
+    <property name="initialRedeliveryDelay" value="2000" />
+    <property name="useExponentialBackOff" value="true" />
+    <property name="backOffMultiplier" value="2" />
   </bean>
 
+  <bean id="handleFaultProcessor" class="org.apache.servicemix.camel.su8.HandleFaultProcessor"
/>
+
 </beans>
+



Mime
View raw message