Author: davsclaus
Date: Sun Jun 8 07:40:23 2008
New Revision: 664510
URL: http://svn.apache.org/viewvc?rev=664510&view=rev
Log:
CAMEL-589: Cleanup of sample. Added AOP to the sample as well for a kind of
advance sample how spring, aop and camel fits well together
Added:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
(with props)
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties
(with props)
Removed:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/CamelServer.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/JmsBroker.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.xml
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/README.txt
activemq/camel/trunk/examples/camel-example-spring-jms/pom.xml
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client.xml
Modified: activemq/camel/trunk/examples/camel-example-spring-jms/README.txt
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/README.txt?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/README.txt (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/README.txt Sun Jun
8 07:40:23 2008
@@ -5,7 +5,12 @@
It can be run using Maven.
The example consumes messages from a queue and invoke the bean
-with the received message
+with the received message.
+
+The Server is required to be running when you try the clients.
+
+The Server is also configued with an AOP aspect that does audit trails of the
invocation
+of the business service and uses Camel for mediation of the storage of the
audit message.
For the latest & greatest documentation on how to use this example please see:
http://cwiki.apache.org/CAMEL/tutorial-jmsremoting.html
Modified: activemq/camel/trunk/examples/camel-example-spring-jms/pom.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/pom.xml?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
--- activemq/camel/trunk/examples/camel-example-spring-jms/pom.xml (original)
+++ activemq/camel/trunk/examples/camel-example-spring-jms/pom.xml Sun Jun 8
07:40:23 2008
@@ -17,81 +17,114 @@
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>examples</artifactId>
- <version>1.4-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-example-spring-jms</artifactId>
- <name>Camel :: Example :: Spring :: JMS </name>
- <description>An example using Spring XML to talk to the JMS
server</description>
-
- <dependencies>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.14</version>
- </dependency>
- <dependency>
- <groupId>org.apache.activemq</groupId>
- <artifactId>activemq-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jms</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring</artifactId>
- </dependency>
-
- <!-- for testing -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>CamelServer</id>
- <properties>
-
<target.main.class>org.apache.camel.example.server.CamelServer</target.main.class>
- </properties>
- </profile>
- <profile>
- <id>CamelClient</id>
- <properties>
-
<target.main.class>org.apache.camel.example.client.CamelClient</target.main.class>
- </properties>
- </profile>
- <profile>
- <id>CamelClientRemoting</id>
- <properties>
-
<target.main.class>org.apache.camel.example.client.CamelClientRemoting</target.main.class>
- </properties>
- </profile>
- </profiles>
- <build>
- <plugins>
- <!-- Allows the example to be run via 'mvn compile exec:java' -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <configuration>
- <mainClass>${target.main.class}</mainClass>
- <includePluginDependencies>false</includePluginDependencies>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>examples</artifactId>
+ <version>1.4-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-spring-jms</artifactId>
+ <name>Camel :: Example :: Spring :: JMS</name>
+ <description>An example using Spring XML to talk to the JMS server from
two kind of client techniques
+ and having AOP aspect to perform audit trails using Camel for record
storage
+ </description>
+
+ <dependencies>
+ <!-- required by both client and server -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jms</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>activemq-core</artifactId>
+ </dependency>
+
+ <!-- xbean is required for ActiveMQ broker configuration in the spring
xml file -->
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ </dependency>
+
+ <!-- required jars for aspectj AOP support -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-aop</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjrt</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.aspectj</groupId>
+ <artifactId>aspectjweaver</artifactId>
+ <version>1.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>cglib</groupId>
+ <artifactId>cglib-nodep</artifactId>
+ <version>2.1_3</version>
+ </dependency>
+
+ <!-- for logging using log4j.properties in src/main/resources -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>CamelServer</id>
+ <properties>
+ <!-- we use Camel spring Main class as the server got all what
it needs to start in the camel-server.xml file -->
+ <!-- the argument isn't needed as Camel will default scan in
the META-INF/spring folder for all spring XML files -->
+
<target.main.class>org.apache.camel.spring.Main</target.main.class>
+ <target.cmd.args>-a
META-INF/spring/camel-server.xml</target.cmd.args>
+ </properties>
+ </profile>
+ <profile>
+ <id>CamelClient</id>
+ <properties>
+ <!-- we start using our own class to control what we do in the
main -->
+
<target.main.class>org.apache.camel.example.client.CamelClient</target.main.class>
+ </properties>
+ </profile>
+ <profile>
+ <id>CamelClientRemoting</id>
+ <properties>
+ <!-- we start using our own class to control what we do in the
main -->
+
<target.main.class>org.apache.camel.example.client.CamelClientRemoting</target.main.class>
+ </properties>
+ </profile>
+ </profiles>
+ <build>
+ <plugins>
+ <!-- Allows the example to be run via 'mvn compile exec:java' -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <configuration>
+ <mainClass>${target.main.class}</mainClass>
+
<includePluginDependencies>false</includePluginDependencies>
+ <commandlineArgs>${target.cmd.args}</commandlineArgs>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
</project>
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClient.java
Sun Jun 8 07:40:23 2008
@@ -18,7 +18,7 @@
import org.apache.camel.ExchangePattern;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.component.jms.JmsExchange;
+import org.apache.camel.CamelContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -29,19 +29,18 @@
*/
public final class CamelClient {
- private CamelClient() {
- // The main class
- }
-
- public static void main(final String[] args) {
+ public static void main(final String[] args) throws Exception {
+ System.out.println("Notice this client requires that the CamelServer
is already running!");
ApplicationContext context = new
ClassPathXmlApplicationContext("camel-client.xml");
- ProducerTemplate<JmsExchange> camelTemplate =
(ProducerTemplate)context.getBean("camelTemplate");
+ ProducerTemplate camelTemplate = (ProducerTemplate)
context.getBean("camelTemplate");
+ System.out.println("Invoking the multiply with 22");
+ // as opposed to the CamelClientRemoting example we need to define the
service URI in this java code
int response = (Integer)camelTemplate.sendBody("jms:queue:numbers",
ExchangePattern.InOut, 22);
- System.out.println("Invoking the multiply with 22, the result is " +
response);
- System.exit(0);
+ System.out.println("... the result is: " + response);
+ System.exit(0);
}
}
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/client/CamelClientRemoting.java
Sun Jun 8 07:40:23 2008
@@ -27,18 +27,20 @@
*/
public final class CamelClientRemoting {
- private CamelClientRemoting() {
- // the main class
- }
-
public static void main(final String[] args) {
+ System.out.println("Notice this client requires that the CamelServer
is already running!");
ApplicationContext context = new
ClassPathXmlApplicationContext("camel-client-remoting.xml");
+ // just get the proxy to the service and we as the client can use the
"proxy" as it was
+ // a local object we are invocing. Camel will under the covers do the
remote communication
+ // to the remote ActiveMQ server and fetch the response.
Multiplier multiplier = (Multiplier)context.getBean("multiplierProxy");
- int response = multiplier.multiply(22);
- System.out.println("Invoking the multiply with 22, the result is " +
response);
- System.exit(0);
+ System.out.println("Invoking the multiply with 33");
+ int response = multiplier.multiply(33);
+ System.out.println("... the result is: " + response);
+
+ System.exit(0);
}
}
Added:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java?rev=664510&view=auto
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
(added)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
Sun Jun 8 07:40:23 2008
@@ -0,0 +1,50 @@
+/**
+ * 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.
+ */
+package org.apache.camel.example.server;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Before;
+import org.springframework.beans.factory.annotation.Required;
+
+/**
+ * For audit tracking of all incoming invocations of our business (Multiplier)
+ */
[EMAIL PROTECTED]
+public class AuditTracker {
+
+ // endpoint we use for backup store of audit tracks
+ private Endpoint store;
+
+ @Required
+ public void setStore(Endpoint store) {
+ this.store = store;
+ }
+
+ @Before("execution(* org.apache.camel.example.server.Multiplier.*(..)) &&
args(originalNumber)")
+ public void audit(int originalNumber) throws Exception {
+ String msg = "Someone called us with this number " + originalNumber;
+ System.out.println(msg);
+
+ // now send the message to the backup store using the Camel Message
Endpoint pattern
+ Exchange exchange = store.createExchange();
+ exchange.getIn().setBody(msg);
+ store.createProducer().process(exchange);
+ }
+
+}
Propchange:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/AuditTracker.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/ServerRoutes.java
Sun Jun 8 07:40:23 2008
@@ -23,13 +23,9 @@
*/
public class ServerRoutes extends RouteBuilder {
- /*
- * (non-Javadoc)
- *
- * @see org.apache.camel.builder.RouteBuilder#configure()
- */
@Override
public void configure() throws Exception {
+ // invoke the bean with the id multiplier, and its multiply method
from("jms:queue:numbers").beanRef("multiplier", "multiply");
}
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/java/org/apache/camel/example/server/Treble.java
Sun Jun 8 07:40:23 2008
@@ -24,11 +24,6 @@
@Service(value = "multiplier")
public class Treble implements Multiplier {
- /*
- * (non-Javadoc)
- *
- * @see org.example.server.Multiplier#multiply(int)
- */
public int multiply(final int originalNumber) {
return originalNumber * 3;
}
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/META-INF/spring/camel-server.xml
Sun Jun 8 07:40:23 2008
@@ -17,28 +17,54 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:camel="http://activemq.apache.org/camel/schema/spring"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context
- http://schemas.leadx.com/spring/spring-context-2.5.xsd
- http://activemq.apache.org/camel/schema/spring
-
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd">
-
- <context:component-scan base-package="org.apache.camel.example.server"
/>
-
- <camel:camelContext id="camel">
- <camel:package>org.apache.camel.example.server</camel:package>
- </camel:camelContext>
-
- <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory">
- <bean
class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL"
value="tcp://localhost:61616" />
- </bean>
- </property>
- </bean>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xmlns:camel="http://activemq.apache.org/camel/schema/spring"
+ xmlns:broker="http://activemq.apache.org/schema/core"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
+ http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd
+ http://activemq.apache.org/schema/core
http://activemq.apache.org/schema/core/activemq-core-5.1.0.xsd">
+
+ <!-- turn on AspejctJ AOP to weave all @Aspects beans declared in this
spring xml file -->
+ <aop:aspectj-autoproxy/>
+
+ <!-- let Spring do its IoC stuff in this package -->
+ <context:component-scan base-package="org.apache.camel.example.server"/>
+
+ <!-- declare a camel context that scans for classes that is RouteBuilder
+ in the package org.apache.camel.example.server -->
+ <camel:camelContext id="camel">
+ <camel:package>org.apache.camel.example.server</camel:package>
+ </camel:camelContext>
+
+ <!-- lets configure the ActiveMQ JMS broker server to listen on TCP 61616
-->
+ <broker:broker useJmx="false" persistent="false" brokerName="localhost">
+ <broker:transportConnectors>
+ <broker:transportConnector name="tcp" uri="tcp://localhost:61616"/>
+ </broker:transportConnectors>
+ </broker:broker>
+
+ <!-- lets configure the Camel JMS consumer to use the ActiveMQ broker
declared above -->
+ <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
+ <property name="connectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL"
+
value="vm://localhost?broker.persistent=false&broker.useJmx=false"/>
+ </bean>
+ </property>
+ </bean>
+
+ <!-- to show aspect AOP stuff -->
+ <bean id="AuditTracker"
class="org.apache.camel.example.server.AuditTracker">
+ <!-- define what store to use for audit backup -->
+ <property name="store" ref="AuditStore"/>
+ </bean>
+
+ <!-- the audit store endpoint is configued as file based -->
+ <camel:endpoint id="AuditStore" uri="file://target/store?append=false"/>
</beans>
\ No newline at end of file
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client-remoting.xml
Sun Jun 8 07:40:23 2008
@@ -17,28 +17,29 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:camel="http://activemq.apache.org/camel/schema/spring"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://activemq.apache.org/camel/schema/spring
-
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://activemq.apache.org/camel/schema/spring"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd">
- <camel:camelContext id="camel" />
- <camel:template id="camelTemplate" />
+ <camel:camelContext id="camel"/>
+ <camel:template id="camelTemplate"/>
- <camel:proxy
- id="multiplierProxy"
- serviceInterface="org.apache.camel.example.server.Multiplier"
- serviceUrl="jms:queue:numbers"
- />
+ <!-- Camel proxy for a given service, in this case the JMS queue -->
+ <camel:proxy
+ id="multiplierProxy"
+ serviceInterface="org.apache.camel.example.server.Multiplier"
+ serviceUrl="jms:queue:numbers"
+ />
- <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory">
- <bean
class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL"
value="tcp://localhost:61616" />
- </bean>
- </property>
- </bean>
+ <!-- Camel JMSProducer to be able to send messages to a remote Active MQ
server -->
+ <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
+ <property name="connectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616"/>
+ </bean>
+ </property>
+ </bean>
</beans>
\ No newline at end of file
Modified:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client.xml
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client.xml?rev=664510&r1=664509&r2=664510&view=diff
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client.xml
(original)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/camel-client.xml
Sun Jun 8 07:40:23 2008
@@ -17,22 +17,22 @@
-->
<beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:camel="http://activemq.apache.org/camel/schema/spring"
- xsi:schemaLocation="http://www.springframework.org/schema/beans
- http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://activemq.apache.org/camel/schema/spring
-
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:camel="http://activemq.apache.org/camel/schema/spring"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://activemq.apache.org/camel/schema/spring
http://activemq.apache.org/camel/schema/spring/camel-spring-1.3.0.xsd">
- <camel:camelContext id="camel" />
- <camel:template id="camelTemplate" />
-
- <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
- <property name="connectionFactory">
- <bean
class="org.apache.activemq.ActiveMQConnectionFactory">
- <property name="brokerURL"
value="tcp://localhost:61616" />
- </bean>
- </property>
- </bean>
+ <camel:camelContext id="camel"/>
+ <camel:template id="camelTemplate"/>
+
+ <!-- Camel JMSProducer to be able to send messages to a remote Active MQ
server -->
+ <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
+ <property name="connectionFactory">
+ <bean class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL" value="tcp://localhost:61616"/>
+ </bean>
+ </property>
+ </bean>
</beans>
\ No newline at end of file
Added:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties?rev=664510&view=auto
==============================================================================
---
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties
(added)
+++
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties
Sun Jun 8 07:40:23 2008
@@ -0,0 +1,31 @@
+## ------------------------------------------------------------------------
+## 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.
+## ------------------------------------------------------------------------
+
+#
+# The logging properties used for eclipse testing, We want to see INFO output
on the console.
+#
+log4j.rootLogger=INFO, out
+
+#
+# uncomment the following line to enable debugging of Camel
+#
+#log4j.logger.org.apache.camel=DEBUG
+#log4j.logger.org.springframework=DEBUG
+
+log4j.appender.out=org.apache.log4j.ConsoleAppender
+log4j.appender.out.layout=org.apache.log4j.PatternLayout
+log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p %m%n
Propchange:
activemq/camel/trunk/examples/camel-example-spring-jms/src/main/resources/log4j.properties
------------------------------------------------------------------------------
svn:eol-style = native