Author: davsclaus
Date: Wed Dec 28 15:27:49 2011
New Revision: 1225206
URL: http://svn.apache.org/viewvc?rev=1225206&view=rev
Log:
4830: This is the walk through example, so we should keep it simple as in the
documentation.
Removed:
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/JmsToFileClient.java
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/JmsToFileRoute.java
camel/trunk/examples/camel-example-jms-file/src/main/resources/META-INF/spring/
camel/trunk/examples/camel-example-jms-file/src/main/resources/features.xml
camel/trunk/examples/camel-example-jms-file/src/test/
Modified:
camel/trunk/examples/camel-example-jms-file/pom.xml
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java
Modified: camel/trunk/examples/camel-example-jms-file/pom.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-jms-file/pom.xml?rev=1225206&r1=1225205&r2=1225206&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-jms-file/pom.xml (original)
+++ camel/trunk/examples/camel-example-jms-file/pom.xml Wed Dec 28 15:27:49 2011
@@ -28,32 +28,27 @@
</parent>
<artifactId>camel-example-jms-file</artifactId>
- <packaging>bundle</packaging>
+ <packaging>jar</packaging>
<name>Camel :: Example :: JMS-File</name>
<description>An example that persists messages from JMS to
files</description>
- <properties>
-
<camel.osgi.export.pkg>org.apache.camel.example.jmstofile.*</camel.osgi.export.pkg>
-
<camel.osgi.import.additional>org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool</camel.osgi.import.additional>
- </properties>
-
<dependencies>
+ <!-- Camel dependencies -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
</dependency>
+ <!-- ActiveMQ dependencies -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
</dependency>
-
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-camel</artifactId>
@@ -64,7 +59,6 @@
</exclusion>
</exclusions>
</dependency>
-
<dependency>
<groupId>org.apache.xbean</groupId>
<artifactId>xbean-spring</artifactId>
@@ -76,21 +70,15 @@
</exclusions>
</dependency>
- <!-- logging -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
+ <!-- logging -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
</dependencies>
@@ -98,50 +86,13 @@
<profile>
<id>Example</id>
<properties>
- <!--
- Starting the camel-cxf example of
routing the SOAP over http
- message to SOAP over JMS Server
- -->
<target.main.class>org.apache.camel.example.jmstofile.CamelJmsToFileExample</target.main.class>
</properties>
</profile>
- <profile>
- <id>Client</id>
- <properties>
- <!--
- Starting the camel-cxf example of
routing the SOAP over http
- message to SOAP over JMS Server
- -->
-
<target.main.class>org.apache.camel.example.jmstofile.JmsToFileClient</target.main.class>
- </properties>
- </profile>
</profiles>
<build>
<plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
-
<artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
-
<goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
-
<file>target/classes/features.xml</file>
-
<type>xml</type>
-
<classifier>features</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
<!-- Allows the example to be run via 'mvn compile
exec:java' -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -153,4 +104,5 @@
</plugin>
</plugins>
</build>
+
</project>
Modified:
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java
URL:
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java?rev=1225206&r1=1225205&r2=1225206&view=diff
==============================================================================
---
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java
(original)
+++
camel/trunk/examples/camel-example-jms-file/src/main/java/org/apache/camel/example/jmstofile/CamelJmsToFileExample.java
Wed Dec 28 15:27:49 2011
@@ -20,8 +20,6 @@ import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.camel.CamelContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.jms.JmsComponent;
@@ -31,8 +29,6 @@ import org.apache.camel.impl.DefaultCame
* An example class for demonstrating some of the basics behind Camel. This
* example sends some text messages on to a JMS Queue, consumes them and
* persists them to disk
- *
- * @version
*/
public final class CamelJmsToFileExample {
@@ -52,16 +48,8 @@ public final class CamelJmsToFileExample
// Add some configuration by hand ...
// START SNIPPET: e3
context.addRoutes(new RouteBuilder() {
-
public void configure() {
from("test-jms:queue:test.queue").to("file://test");
- // set up a listener on the file component
- from("file://test").process(new Processor() {
-
- public void process(Exchange e) {
- System.out.println("Received exchange: " + e.getIn());
- }
- });
}
});
// END SNIPPET: e3
@@ -85,6 +73,8 @@ public final class CamelJmsToFileExample
template.sendBody("test-jms:queue:test.queue", "Test Message: " +
i);
}
// END SNIPPET: e5
+
+ // wait a bit and then stop
Thread.sleep(1000);
context.stop();
}