Hi Monica,

I think we can introduce a new parameter which accepts the velocity's properties configuration.

I just created a JIRA[1] for it, before we resolved this issue, I don't think current camel-velocity supports this configuration

Before that , I think you may try to let the message the velocity endpoint twice.

from(inputEndpoint)
  .to("velocity:com/foo/bar/util/Headers.vm")
  .to("velocity:com/foo/bar/util/OrderXml.vm")
  .to(destinationEndpoint)
  .end();

And you OrderXml template can be
{Body}
<Order>
  <order xml snipped...>
  </Order>

[1]https://issues.apache.org/activemq/browse/CAMEL-2091

Willem
Monica_G wrote:
Hi,

I am using the camel-velocity component and want to call #parse() in my vm
template.  However, I get the following exception:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'com/foo/bar/util/Header.vm'.
Does anyone know how to resolve this?

Here is what I am doing:

In my RouteBuilder I have the following:

public void configure() throws Exception {
 //Note: the inputEndpoint and destinationEndpoint are set via spring
injection
from(inputEndpoint) .to("velocity:com/foo/bar/util/OrderXml.vm")
 .to(destinationEndpoint)
 .end();
}

In my vm template I have the following:
#parse("com/foo/bar/util/Header.vm")
<Order>
<order xml snipped...>
</Order>

I want to insert the Header.vm because I have some standard xml header info
which I want to be able to reuse across xml files.

I've read the
http://velocity.apache.org/engine/devel/developer-guide.html#configurationexamples
page and I'm wondering if I need to set the 'file.resource.loader.path'
value.  However I'm not sure how to do this through camel, or if this is
even the right approach.

Thanks,

Monica

Reply via email to