Align code with the wiki

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8429c59b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8429c59b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8429c59b

Branch: refs/heads/master
Commit: 8429c59b289f270a75e223caadd324c481b7da08
Parents: 257ef8f
Author: Jyrki Ruuskanen <yur...@kotikone.fi>
Authored: Thu Nov 27 20:30:13 2014 +0200
Committer: Willem Jiang <willem.ji...@gmail.com>
Committed: Tue Dec 2 10:53:34 2014 +0800

----------------------------------------------------------------------
 .../src/main/java/__className__.java            |  1 -
 .../main/java/internal/__className__Route.java  | 21 ++++++++++++++------
 2 files changed, 15 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8429c59b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/__className__.java
----------------------------------------------------------------------
diff --git 
a/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/__className__.java
 
b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/__className__.java
index 8af72d0..3f50d60 100644
--- 
a/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/__className__.java
+++ 
b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/__className__.java
@@ -36,7 +36,6 @@ import org.apache.felix.scr.annotations.*;
     @Property(name = "active", value = "true"),
     @Property(name = "from", value = "timer:foo?period=5000"),
     @Property(name = "to", value = "log:foo?showHeaders=true"),
-    @Property(name = "summaryLogging", value = "false"),
     @Property(name = "messageOk", value = "Success: {{from}} -> {{to}}"),
     @Property(name = "messageError", value = "Failure: {{from}} -> {{to}}"),
     @Property(name = "maximumRedeliveries", value = "0"),

http://git-wip-us.apache.org/repos/asf/camel/blob/8429c59b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/internal/__className__Route.java
----------------------------------------------------------------------
diff --git 
a/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/internal/__className__Route.java
 
b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/internal/__className__Route.java
index a44921d..04d85d3 100644
--- 
a/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/internal/__className__Route.java
+++ 
b/tooling/archetypes/camel-archetype-scr/src/main/resources/archetype-resources/src/main/java/internal/__className__Route.java
@@ -30,17 +30,11 @@ public class ${className}Route extends RouteBuilder {
     SimpleRegistry registry;
 
     // Configured fields
-    @SuppressWarnings("unused")
     private String camelRouteId;
-    @SuppressWarnings("unused")
     private Integer maximumRedeliveries;
-    @SuppressWarnings("unused")
     private Long redeliveryDelay;
-    @SuppressWarnings("unused")
     private Double backOffMultiplier;
-    @SuppressWarnings("unused")
     private Long maximumRedeliveryDelay;
-    protected boolean summaryLogging = false;
 
     public ${className}Route(final SimpleRegistry registry) {
         this.registry = registry;
@@ -61,8 +55,23 @@ public class ${className}Route extends RouteBuilder {
             .maximumRedeliveryDelay(maximumRedeliveryDelay));
 
         from("{{from}}")
+            .startupOrder(2)
             .routeId(camelRouteId)
+            .onCompletion()
+                .to("direct:processCompletion")
+            .end()
+            .removeHeaders("CamelHttp*")
             .to("{{to}}");
+
+        from("direct:processCompletion")
+            .startupOrder(1)
+            .routeId(camelRouteId + ".completion")
+            .choice()
+            .when(simple("${exception} == null"))
+                .log("{{messageOk}}")
+            .otherwise()
+                .log(LoggingLevel.ERROR, "{{messageError}}")
+            .end();
        }
 
     public void checkProperties() {

Reply via email to