servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r721466 - in /servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src: main/java/org/apache/servicemix/camel/ test/java/org/apache/servicemix/camel/su8/ test/java/org/apache/servicemix/camel/su9/ test/resourc...
Date Fri, 28 Nov 2008 12:58:30 GMT
Author: gertv
Date: Fri Nov 28 04:58:29 2008
New Revision: 721466

URL: http://svn.apache.org/viewvc?rev=721466&view=rev
Log:
SM-1686: Inconsistent Exception handling when using RobustInOnly JBI MEP

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

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiExchange.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiExchange.java?rev=721466&r1=721465&r2=721466&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiExchange.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiExchange.java
Fri Nov 28 04:58:29 2008
@@ -25,6 +25,7 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.impl.DefaultExchange;
+import org.apache.servicemix.jbi.FaultException;
 
 /**
  * An {@link org.apache.camel.Exchange} working with JBI which exposes the underlying JBI
@@ -163,6 +164,10 @@
                     if ("fault".equals(name)) {
                         Fault f = messageExchange.createFault();
                         messageExchange.setFault(f);
+                        if (getPattern().equals(ExchangePattern.RobustInOnly)
+                            || getPattern().equals(ExchangePattern.RobustOutOnly)) {    
                       
+                            setException(new FaultException("Fault occured for " + getPattern()
+ " exchange", messageExchange, f));
+                        }                        
                         msg = f;
                     } else {
                         msg = messageExchange.createMessage();

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su8/HandleFaultProcessor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su8/HandleFaultProcessor.java?rev=721466&r1=721465&r2=721466&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su8/HandleFaultProcessor.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su8/HandleFaultProcessor.java
Fri Nov 28 04:58:29 2008
@@ -56,8 +56,10 @@
                             if (faultBody instanceof Throwable) {
                                 exchange.setException((Throwable)faultBody);
                             } else {
-                                exchange.setException(new CamelException("Message contains
fault of type "
-                                    + faultBody.getClass().getName() + ":\n" + faultBody));
+                                if (exchange.getException() == null) {
+                                    exchange.setException(new CamelException("Message contains
fault of type "
+                                        + faultBody.getClass().getName() + ":\n" + faultBody));
+                                }
                             }
                         }
                     }                    
@@ -80,8 +82,10 @@
                 if (faultBody instanceof Throwable) {
                     exchange.setException((Throwable)faultBody);
                 } else {
-                    exchange.setException(new CamelException("Message contains fault of type
"
-                        + faultBody.getClass().getName() + ":\n" + faultBody));
+                    if (exchange.getException() == null) {                    
+                        exchange.setException(new CamelException("Message contains fault
of type "
+                            + faultBody.getClass().getName() + ":\n" + faultBody));
+                    }
                 }
             }
         }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su9/HandleFaultProcessor.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su9/HandleFaultProcessor.java?rev=721466&r1=721465&r2=721466&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su9/HandleFaultProcessor.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/java/org/apache/servicemix/camel/su9/HandleFaultProcessor.java
Fri Nov 28 04:58:29 2008
@@ -56,8 +56,10 @@
                             if (faultBody instanceof Throwable) {
                                 exchange.setException((Throwable)faultBody);
                             } else {
-                                exchange.setException(new CamelException("Message contains
fault of type "
-                                    + faultBody.getClass().getName() + ":\n" + faultBody));
+                                if (exchange.getException() == null) {
+                                    exchange.setException(new CamelException("Message contains
fault of type "
+                                        + faultBody.getClass().getName() + ":\n" + faultBody));
+                                }
                             }
                         }
                     }                    
@@ -80,8 +82,10 @@
                 if (faultBody instanceof Throwable) {
                     exchange.setException((Throwable)faultBody);
                 } else {
-                    exchange.setException(new CamelException("Message contains fault of type
"
-                        + faultBody.getClass().getName() + ":\n" + faultBody));
+                    if (exchange.getException() == null) {                    
+                        exchange.setException(new CamelException("Message contains fault
of type "
+                            + faultBody.getClass().getName() + ":\n" + faultBody));
+                    }
                 }
             }
         }

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su9-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/su9-src/camel-context.xml?rev=721466&r1=721465&r2=721466&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su9-src/camel-context.xml
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-camel/src/test/resources/org/apache/servicemix/camel/su9-src/camel-context.xml
Fri Nov 28 04:58:29 2008
@@ -29,7 +29,7 @@
     <route errorHandlerRef="deadLetterErrorHandler">
       <from uri="jbi:service:urn:test:fault-handled-true"/>
       <onException>
-        <!-- Catch exception from in-only message exchange -->
+        <!-- Catch exception from in-only/robust-in-only message exchange -->
         <exception>org.apache.servicemix.jbi.FaultException</exception>
         <redeliveryPolicy maximumRedeliveries="0"/>
         <handled>
@@ -37,15 +37,6 @@
         </handled>
         <to uri="jbi:service:urn:test:receiver-service"/>
       </onException>
-      <onException>
-        <!-- Catch exception from robust-in-only message exchange -->
-        <exception>org.apache.camel.CamelException</exception>
-        <redeliveryPolicy maximumRedeliveries="0"/>
-        <handled>
-          <constant>true</constant>
-        </handled>
-        <to uri="jbi:service:urn:test:receiver-service"/>
-      </onException>
       <interceptor ref="handleFaultProcessor">
         <to uri="jbi:service:urn:test:faulty-service"/>
       </interceptor>



Mime
View raw message