Yeah, you kinda have to read it a few times to catch that :) I've updated the docs to be a bit more explicit.
If you want to extend VelocityEndpoint to reload templates most of the work is already done in the onExchange method (it already creates a new velocity context every time). Though, if you have the contentCache option enabled you would need to ensure that the buffer in ResourceBasedEndpoint gets cleared/reloaded with your new template. Also I've put up a unit test of spinning up new velocity endpoints dynamically (via a custom bean as I mentioned before) if you'd like to use that instead http://svn.apache.org/repos/asf/camel/trunk/components/camel-velocity/src/test/java/org/apache/camel/component/velocity/VelocityDynamicTemplateTest.java Let us know how you fare. Cheers, Jon On Tue, Jul 21, 2009 at 6:47 PM, tide08 <[email protected]> wrote: > > Aaah..I totally misunderstood, but it was not explicit in documentation. > > Would it be good idea to extend velocityEndpoint? If yes, what needs to be > done on templateName change? Velocity context refresh? Is there any helpful > example I can look at? > > Thanks again! > > > tide08 wrote: > > > > Can someone provide information on how to make use of > > org.apache.camel.velocity.resourceUri header for velocity component? As > > per document this should be templateName as String. > > > > I don't want to provide templateName in route but use the header > mentioned > > above. But looks like templateName is required for route to be correct. > > > > from("direct:start") > > .to("velocity:testTemplate.vm") > > > > I tried providing dummy templateName in route and than set the > > org.apache.camel.velocity.resourceUri header with actual template I want > > to use but it still uses the dummy template provided in route. > > > > Am I misunderstanding use for that header? Please help. > > > > Thanks > > > > -- > View this message in context: > http://www.nabble.com/Velocity-component-use-of-org.apache.camel.velocity.resourceUri-header-tp24592228p24596026.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Cheers, Jon http://janstey.blogspot.com/
