You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Spring XQuery Example

The Spring XQuery example uses no Java code; its configured purely using a Spring XML configuration file. It parsers some files from a directory, transforms them using XQuery then sends them to a message queue. To make it easy to look at the generated files, we also have another route which consumes from the JMS queue and writes them to an output directory.

To run the example we use the Camel Maven Plugin. For example from the source or binary distribution the following should work

cd examples/camel-example-spring-xquery
mvn camel:run

What this does is boot up the Spring ApplicationContext defined in the file META-INF/spring/camel-context on the classpath. This is a regular Spring XML document which uses the Camel Xml Configuration to configure a CamelContext.

Also note at the end of this XML example file we explicitly configure the ActiveMQ component with details of how to connect to the broker.

You can see the generated files in the target/outputFiles directory which are the transformed messages read from the JMS queue.

  • No labels