Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Notice how we can reuse the namespace prefixes, foo in this case, in the XPath expression for easier namespace based XQuery expressions!

Using XQuery as an endpoint

Sometimes an XQuery expression can be quite large; it can essentally be used for Templating. So you may want to use an XQuery Endpoint so you can route using XQuery templates.

The following example shows how to take a message of an ActiveMQ queue (MyQueue) and transform it using XQuery and send it to MQSeries.

Code Block

  <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
    <route>
      <from uri="activemq:MyQueue"/>
      <to uri="xquery:com/acme/someTransform.xquery"/>
      <to uri="mqseries:SomeOtherQueue"/>
    </route>
  </camelContext>

Examples

Here is a simple example using an XQuery expression as a predicate in a Message Filter

...