You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2012/02/11 14:12:47 UTC

svn commit: r1243052 - in /camel/branches/camel-2.9.x: ./ camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/model/ camel-core/src/main/java/org/apache/camel/processor/ camel-core/src/test/java/org/apache/camel/processor/

Author: davsclaus
Date: Sat Feb 11 13:12:47 2012
New Revision: 1243052

URL: http://svn.apache.org/viewvc?rev=1243052&view=rev
Log:
CAMEL-5000: Fixed error handler not called when recipient list has non existing endpoint.

Added:
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointErrorHandlerTest.java
      - copied unchanged from r1243046, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointErrorHandlerTest.java
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointIgnoreInvalidEndpointsTest.java
      - copied unchanged from r1243046, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RecipientListInvalidEndpointIgnoreInvalidEndpointsTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
    camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
    svn:mergeinfo = /camel/trunk:1243046

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/RecipientList.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/RecipientList.java?rev=1243052&r1=1243051&r2=1243052&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/RecipientList.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/RecipientList.java Sat Feb 11 13:12:47 2012
@@ -53,5 +53,6 @@ public @interface RecipientList {
     String executorServiceRef() default "";
     long timeout() default 0;
     String onPrepareRef() default "";
+    @Deprecated
     boolean shareUnitOfWork() default false;
 }
\ No newline at end of file

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=1243052&r1=1243051&r2=1243052&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java Sat Feb 11 13:12:47 2012
@@ -254,17 +254,7 @@ public abstract class ProcessorDefinitio
                 // only wrap the parent (not the children of the multicast)
                 wrapChannelInErrorHandler(channel, routeContext);
             } else {
-                log.trace("{} is part of multicast/recipientList which have special error handling so no error handler is applied", defn);
-            }
-        } else if (defn instanceof RecipientListDefinition) {
-            // do not use error handler for recipient list as it offers fine grained error handlers for its outputs
-            // however if share unit of work is enabled, we need to wrap an error handler on the recipient list parent
-            RecipientListDefinition def = (RecipientListDefinition) defn;
-            if (def.isShareUnitOfWork()) {
-                // note a recipient list cannot have children so no need for a child == null check
-                wrapChannelInErrorHandler(channel, routeContext);
-            } else {
-                log.trace("{} is part of multicast/recipientList which have special error handling so no error handler is applied", defn);
+                log.trace("{} is part of multicast which have special error handling so no error handler is applied", defn);
             }
         } else {
             // use error handler by default or if configured to do so

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java?rev=1243052&r1=1243051&r2=1243052&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/model/RecipientListDefinition.java Sat Feb 11 13:12:47 2012
@@ -71,6 +71,7 @@ public class RecipientListDefinition<Typ
     @XmlTransient
     private Processor onPrepare;
     @XmlAttribute
+    @Deprecated
     private Boolean shareUnitOfWork;
 
     public RecipientListDefinition() {
@@ -308,6 +309,7 @@ public class RecipientListDefinition<Typ
      * @return the builder.
      * @see org.apache.camel.spi.SubUnitOfWork
      */
+    @Deprecated
     public RecipientListDefinition<Type> shareUnitOfWork() {
         setShareUnitOfWork(true);
         return this;
@@ -428,14 +430,17 @@ public class RecipientListDefinition<Typ
         this.onPrepare = onPrepare;
     }
 
+    @Deprecated
     public Boolean getShareUnitOfWork() {
         return shareUnitOfWork;
     }
 
+    @Deprecated
     public void setShareUnitOfWork(Boolean shareUnitOfWork) {
         this.shareUnitOfWork = shareUnitOfWork;
     }
 
+    @Deprecated
     public boolean isShareUnitOfWork() {
         return shareUnitOfWork != null && shareUnitOfWork;
     }

Modified: camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java?rev=1243052&r1=1243051&r2=1243052&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java (original)
+++ camel/branches/camel-2.9.x/camel-core/src/main/java/org/apache/camel/processor/MulticastProcessor.java Sat Feb 11 13:12:47 2012
@@ -736,14 +736,14 @@ public class MulticastProcessor extends 
     protected void doDone(Exchange original, Exchange subExchange, AsyncCallback callback, boolean doneSync, boolean exhaust) {
         // cleanup any per exchange aggregation strategy
         removeAggregationStrategyFromExchange(original);
-        if (original.getException() != null) {
+        if (original.getException() != null || subExchange != null && subExchange.getException() != null) {
             // multicast uses error handling on its output processors and they have tried to redeliver
             // so we shall signal back to the other error handlers that we are exhausted and they should not
             // also try to redeliver as we will then do that twice
             original.setProperty(Exchange.REDELIVERY_EXHAUSTED, exhaust);
         }
         if (subExchange != null) {
-            // and copy the current result to original so it will contain this exception
+            // and copy the current result to original so it will contain this result of this eip
             ExchangeHelper.copyResults(original, subExchange);
         }
         callback.done(doneSync);