You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by js...@apache.org on 2007/08/24 21:01:55 UTC

svn commit: r569479 - in /activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources: META-INF/maven/ archetype-resources/ archetype-resources/src/data/ archetype-resources/src/main/java/ archetype-resources/src/main/resources/META-INF/spr...

Author: jstrachan
Date: Fri Aug 24 12:01:54 2007
New Revision: 569479

URL: http://svn.apache.org/viewvc?rev=569479&view=rev
Log:
Improved the archetype to make it a bit more of an impressive demo

Added:
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml   (with props)
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml   (with props)
Modified:
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/META-INF/maven/archetype.xml
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/pom.xml
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
    activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml

Modified: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/META-INF/maven/archetype.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/META-INF/maven/archetype.xml?rev=569479&r1=569478&r2=569479&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/META-INF/maven/archetype.xml (original)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/META-INF/maven/archetype.xml Fri Aug 24 12:01:54 2007
@@ -26,5 +26,7 @@
   <resources>
     <resource>src/main/resources/META-INF/spring/camel-context.xml</resource>
     <resource>src/main/resources/log4j.properties</resource>
+    <resource>src/data/message1.xml</resource>
+    <resource>src/data/message2.xml</resource>
   </resources>
 </archetype>

Modified: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/pom.xml?rev=569479&r1=569478&r2=569479&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/pom.xml (original)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/pom.xml Fri Aug 24 12:01:54 2007
@@ -31,7 +31,7 @@
   <url>http://www.myorganization.org</url>
 
   <properties>
-    <camel-version>1.1.0</camel-version>
+    <camel-version>1.1-SNAPSHOT</camel-version>
   </properties>
 
   <dependencies>

Added: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml?rev=569479&view=auto
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml (added)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml Fri Aug 24 12:01:54 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<person user="james">
+  <firstName>James</firstName>
+  <lastName>Strachan</lastName>
+  <city>London</city>
+</person>
\ No newline at end of file

Propchange: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml?rev=569479&view=auto
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml (added)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml Fri Aug 24 12:01:54 2007
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<person user="hiram">
+  <firstName>Hiram</firstName>
+  <lastName>Chirino</lastName>
+  <city>Tampa</city>
+</person>
\ No newline at end of file

Propchange: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/data/message2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java?rev=569479&r1=569478&r2=569479&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java (original)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/java/MyRouteBuilder.java Fri Aug 24 12:01:54 2007
@@ -21,6 +21,8 @@
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.spring.Main;
 
+import static org.apache.camel.builder.xml.XPathBuilder.xpath;
+
 /**
  * A Camel Router
  *
@@ -40,9 +42,16 @@
      */
     public void configure() {
 
-        // TODO create Camel routes here. For example:-
-        //
-        // from("activemq:test.MyQueue").to("file://test");
+        // TODO create Camel routes here.
+
+        // here is a sample which processes the input files
+        // (leaving them in place - see the 'noop' flag)
+        // then performs content based routing on the message
+        // using XPath
+        from("file:src/data?noop=true").
+            choice().
+                when(xpath("/person/city = 'London'")).to("file:target/messages/uk").
+                otherwise().to("file:target/messages/others");
 
     }
 }

Modified: activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml?rev=569479&r1=569478&r2=569479&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml (original)
+++ activemq/camel/trunk/tooling/archetypes/camel-router/src/main/resources/archetype-resources/src/main/resources/META-INF/spring/camel-context.xml Fri Aug 24 12:01:54 2007
@@ -24,7 +24,7 @@
        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">
 
-  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
+  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
     <package>${package}</package>
   </camelContext>