|
Velocity has been edited by Claus Ibsen (Jun 05, 2008). Content:VelocityThe velocity: component allows you to process a message using an Apache Velocity URI formatvelocity:templateName Where templateName is the classpath-local URI of the template to invoke; or the complete URL of the remote template (eg: file://folder/myfile.vm
Hot reloadingThe velocity template resource is by default hot reloadable for both file and classpath resources (expanded jar). Setting the contentCache=true then Camel will only load the resource once, and thus hot reloading is not possible. This scenario can be used in production usage when the resource never changes. SamplesFor example you could use something like from("activemq:My.Queue"). to("velocity:com/acme/MyResponse.vm"); To use a velocity template to formulate a response for a message for InOut message exchanges (where there is a JMSReplyTo header). If you want to use InOnly and consume the message and send it to another destination you could use from("activemq:My.Queue"). to("velocity:com/acme/MyResponse.vm"). to("activemq:Another.Queue"); And to use content cache, eg. for production usage where the .vm template never changes: from("activemq:My.Queue"). to("velocity:com/acme/MyResponse.vm?contentCache=true"). to("activemq:Another.Queue"); And a file based resource: from("activemq:My.Queue"). to("velocity:file://myfolder/MyResponse.vm?contentCache=true"). to("activemq:Another.Queue"); See Also |
Unsubscribe or edit your notifications preferences
