camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r731217 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/model/ProcessorType.java test/java/org/apache/camel/builder/ErrorHandlerTest.java
Date Sun, 04 Jan 2009 10:41:12 GMT
Author: davsclaus
Date: Sun Jan  4 02:41:11 2009
New Revision: 731217

URL: http://svn.apache.org/viewvc?rev=731217&view=rev
Log:
CAMEL-984: Poilished code for wiki samples for error handler

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java?rev=731217&r1=731216&r2=731217&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorType.java
Sun Jan  4 02:41:11 2009
@@ -1463,9 +1463,6 @@
      */
     public Type errorHandler(ErrorHandlerBuilder errorHandlerBuilder) {
         setErrorHandlerBuilder(errorHandlerBuilder);
-        // TODO: davsclaus. I think we need to set the parent so you can use .end() blocks
for
-        // nested error handler with a complex routing
-        //setParent(this);
         return (Type) this;
     }
 

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java?rev=731217&r1=731216&r2=731217&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/ErrorHandlerTest.java
Sun Jan  4 02:41:11 2009
@@ -26,7 +26,6 @@
 import org.apache.camel.management.InstrumentationProcessor;
 import org.apache.camel.management.JmxSystemPropertyKeys;
 import org.apache.camel.processor.DeadLetterChannel;
-import org.apache.camel.processor.DelegateAsyncProcessor;
 import org.apache.camel.processor.FilterProcessor;
 import org.apache.camel.processor.LoggingErrorHandler;
 import org.apache.camel.processor.RedeliveryPolicy;
@@ -37,12 +36,14 @@
  */
 public class ErrorHandlerTest extends TestSupport {
 
-
     public void testOverloadingTheDefaultErrorHandler() throws Exception {
         // START SNIPPET: e1
         RouteBuilder builder = new RouteBuilder() {
             public void configure() {
-                errorHandler(loggingErrorHandler("FOO.BAR"));
+                // use logging error handler
+                errorHandler(loggingErrorHandler("com.mycompany.foo"));
+
+                // here is our regular route
                 from("seda:a").to("seda:b");
             }
         };
@@ -69,9 +70,14 @@
         // START SNIPPET: e2
         RouteBuilder builder = new RouteBuilder() {
             public void configure() {
-                from("seda:a").errorHandler(loggingErrorHandler("FOO.BAR")).to("seda:b");
-                // this route will use the default error handler,
-                // DeadLetterChannel
+                // this route is using a nested logging error handler
+                from("seda:a")
+                    // here we configure the logging error handler
+                    .errorHandler(loggingErrorHandler("com.mycompany.foo"))
+                    // and we continue with the routing here
+                    .to("seda:b");
+
+                // this route will use the default error handler (DeadLetterChannel)
                 from("seda:b").to("seda:c");
             }
         };
@@ -117,7 +123,10 @@
         // START SNIPPET: e3
         RouteBuilder builder = new RouteBuilder() {
             public void configure() {
+                // using dead letter channel with a seda queue for errors
                 errorHandler(deadLetterChannel("seda:errors"));
+
+                // here is our route
                 from("seda:a").to("seda:b");
             }
         };
@@ -141,7 +150,11 @@
         // START SNIPPET: e4
         RouteBuilder builder = new RouteBuilder() {
             public void configure() {
+                // configures dead letter channel to use seda queue for errors and use at
most 2 redelveries
+                // and exponential backoff
                 errorHandler(deadLetterChannel("seda:errors").maximumRedeliveries(2).useExponentialBackOff());
+
+                // here is our route
                 from("seda:a").to("seda:b");
             }
         };



Mime
View raw message