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/09/01 09:58:12 UTC

svn commit: r1379714 - in /camel/trunk/examples/camel-example-activemq-tomcat/src/main: resources/broker.xml resources/camel-config.xml webapp/WEB-INF/web.xml

Author: davsclaus
Date: Sat Sep  1 07:58:11 2012
New Revision: 1379714

URL: http://svn.apache.org/viewvc?rev=1379714&view=rev
Log:
Polished

Modified:
    camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml
    camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml
    camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml

Modified: camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml?rev=1379714&r1=1379713&r2=1379714&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml (original)
+++ camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/broker.xml Sat Sep  1 07:58:11 2012
@@ -16,6 +16,8 @@
     limitations under the License.
 -->
 
+<!-- START SNIPPET: e1 -->
+<!-- this is a spring XML file where we have ActiveMQ Broker embedded -->
 <beans xmlns="http://www.springframework.org/schema/beans"
 	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	   xmlns:broker="http://activemq.apache.org/schema/core"
@@ -26,17 +28,20 @@
 	<!-- create an ActiveMQ broker -->
 	<!-- do not use the shutdown hook as it would cause the broker to shutdown when you press ctrl + c,
 	     instead we will let Spring shutdown the broker -->
-
 	<!-- notice this is a basic AMQ broker configuration, for production usage there is many more
 	     options you may need to configure accordingly to your needs -->
-	<broker:broker id="broker" brokerName="myBroker" useShutdownHook="false" useJmx="true"
-				   persistent="true" dataDirectory="activemq-data">
-		<broker:transportConnectors>
+	<broker id="broker" brokerName="myBroker" useShutdownHook="false" useJmx="true"
+				   persistent="true" dataDirectory="activemq-data"
+				   xmlns="http://activemq.apache.org/schema/core">
+
+		<transportConnectors>
 			<!-- vm transport for intra-jvm communication -->
-			<broker:transportConnector name="vm" uri="vm://myBroker"/>
+			<transportConnector name="vm" uri="vm://myBroker"/>
 			<!-- tcp for external communication -->
-			<broker:transportConnector name="tcp" uri="tcp://0.0.0.0:61616"/>
-		</broker:transportConnectors>
-	</broker:broker>
+			<transportConnector name="tcp" uri="tcp://0.0.0.0:61616"/>
+		</transportConnectors>
+
+	</broker>
 
 </beans>
+<!-- END SNIPPET: e1 -->
\ No newline at end of file

Modified: camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml?rev=1379714&r1=1379713&r2=1379714&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml (original)
+++ camel/trunk/examples/camel-example-activemq-tomcat/src/main/resources/camel-config.xml Sat Sep  1 07:58:11 2012
@@ -16,6 +16,8 @@
     limitations under the License.
 -->
 
+<!-- START SNIPPET: e1 -->
+<!-- this is a spring XML file where we have Camel embedded -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:camel="http://camel.apache.org/schema/spring"
@@ -23,8 +25,10 @@
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
 
+
+	<!-- Here we define Camel, notice the namespace it uses -->
   <camelContext xmlns="http://camel.apache.org/schema/spring">
-	  <!-- feed inbox queue once per second -->
+	  <!-- Camel route to feed the ActiveMQ inbox queue once per second -->
 	  <route>
 		  <from uri="timer:foo?period=1s"/>
 		  <transform>
@@ -33,7 +37,7 @@
 		  <to uri="activemq:queue:inbox"/>
 	  </route>
 
-	  <!-- route from inbox to outbox queue -->
+	  <!-- Camel route to move messages from the ActiveMQ inbox to its outbox queue -->
 	  <route>
 		  <from uri="activemq:queue:inbox"/>
 		  <log message="Routing message from inbox to outbox queue with data ${body}"/>
@@ -42,10 +46,12 @@
 
   </camelContext>
 
-	<!-- create a Camel ActiveMQ component to use -->
+	<!-- create a Camel ActiveMQ component to use, using the Spring bean style -->
 	<!-- we use the vm protocol to communicate intra-jvm which is much faster than tcp -->
-	<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent" depends-on="broker">
+	<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
+		<!-- vm://myBroker is the vm protocol, and myBroker is the broker name -->
 		<property name="brokerURL" value="vm://myBroker?create=false&amp;waitForStart=5000"/>
 	</bean>
 
 </beans>
+<!-- END SNIPPET: e1 -->
\ No newline at end of file

Modified: camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml?rev=1379714&r1=1379713&r2=1379714&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml (original)
+++ camel/trunk/examples/camel-example-activemq-tomcat/src/main/webapp/WEB-INF/web.xml Sat Sep  1 07:58:11 2012
@@ -16,13 +16,15 @@
     limitations under the License.
 -->
 
+<!-- START SNIPPET: e1 -->
+<!-- this is a standard web.xml file, where we use Spring Web to boot our application -->
 <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
 		 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 		 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 
 	<display-name>My Web Application</display-name>
 
-	<!-- location of spring xml files -->
+	<!-- location of spring XML files -->
 	<context-param>
 		<param-name>contextConfigLocation</param-name>
 		<param-value>
@@ -31,9 +33,10 @@
 		</param-value>
 	</context-param>
 
-	<!-- the listener that kick-starts Spring -->
+	<!-- the listener that kick-starts Spring, which loads the XML files and start our application -->
 	<listener>
 		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 	</listener>
 
 </web-app>
+<!-- START SNIPPET: e1 -->
\ No newline at end of file