camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MichaelAtSAG <>
Subject Velocity without java
Date Fri, 02 Dec 2011 18:46:20 GMT
The Apache Camel example for Velocity using Java code to implement the logic.
Is there an example available that does not use java?

We are trying to use a Spring XML approach and cannot figure out how to
connect the message properties into the velocity template.

-Velocity template:-

Dear Purchaser,

We have an ${headers.eventtype} situation. We need
${body.DesiredInventoryLevel} piece(s) for part number ${body.ItemID}.

Please review this situation.

<?xml version="1.0" encoding="UTF-8"?>
<evt:Event xmlns:xsi=""
                <pay:ItemName>Widget for thingy</pay:ItemName>
                <pay:Model>ACME </pay:Model>

-Content file -

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns=""

	<camelContext xmlns="" id="camel"

		<route id="Announcer" startupOrder="3">
			<from uri="file:src/data?noop=true" />
			<setHeader headerName="eventtype">
					<language language="xpath">$eventtype =
					<log message="Announce PartInventoryShortage(b): file - &gt;
jms:InvMgmt" />
					<to uri="velocity:file:src/main/resources/email.vm" />
					<log message="Announce PartInventoryShortage(a): file - &gt; email" />
					<to uri="outputToScreen" />

How do I connect the message properties with the velocity template? Do I
need to set header properties in the Camel context file? I did this for
routing logic, yet the header element shows like this:

We have an **

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message