Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 82361 invoked from network); 21 Jul 2009 18:37:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jul 2009 18:37:02 -0000 Received: (qmail 14000 invoked by uid 500); 21 Jul 2009 18:38:07 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 13961 invoked by uid 500); 21 Jul 2009 18:38:07 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 13951 invoked by uid 99); 21 Jul 2009 18:38:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 18:38:07 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of janstey@gmail.com designates 209.85.220.208 as permitted sender) Received: from [209.85.220.208] (HELO mail-fx0-f208.google.com) (209.85.220.208) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2009 18:37:57 +0000 Received: by fxm4 with SMTP id 4so2612636fxm.20 for ; Tue, 21 Jul 2009 11:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=9x/MdPe0Ni7EV6ML5z6R+4RApA1NLRgT0b6WRqB5nCA=; b=lB4uqN+WBus50fRBsjHk5OFMtdzaUfE9luf5sllcm7pChyprV4Fkc8F6w1HUUHG/H5 MT1xDWZP4fHP1lracG6aJDPHi3kqEFCcz4aYdTLq51oj/Fl9YsuW2/gP6D3f83SkkeeB 1/oUpwzKniyjbcpFTfMFI9z69jHQ5wrP9XOGY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Zqa3anb9REmTJQcDpwFXhRJUdmFwAnRwPNd4AYxmiYJbg3D7smgAPsaqbYAcrDQgys ERcrFifTB6LY8oV6G54fRL/rQe4V3sdoIzWzQ9qkU9ZBA/7ljABPU7n92t356qFbA2hu XXOMLMxOR2MK5bNeJQat1e+HMHNyheBoYMoVg= MIME-Version: 1.0 Received: by 10.204.66.195 with SMTP id o3mr5729363bki.201.1248201455504; Tue, 21 Jul 2009 11:37:35 -0700 (PDT) In-Reply-To: <24592228.post@talk.nabble.com> References: <24592228.post@talk.nabble.com> Date: Tue, 21 Jul 2009 16:07:35 -0230 Message-ID: <2748945d0907211137r36e18073pa71b1a68102802ea@mail.gmail.com> Subject: Re: Velocity component use of org.apache.camel.velocity.resourceUri header From: Jon Anstey To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001636c5a66f5d1bcc046f3b8c38 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5a66f5d1bcc046f3b8c38 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit That header is actually what the camel-velocity component *sets* on the message. You can't use it to dynamically configure the template. To do that you'll probably need to create a custom bean that creates a velocity endpoint and sends to it based on what template you need. Something like public class MyBean { ProducerTemplate template; public void sendToNewTemplate(Exchange exchange) { if (template == null) { template = exchange.getContext().createProducerTemplate(); } template.send("velocity:" + getNewTemplate(), exchange); } private String getNewTemplate() { return bla...; } } should do it. On Tue, Jul 21, 2009 at 3:24 PM, 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-tp24592228p24592228.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Cheers, Jon http://janstey.blogspot.com/ --001636c5a66f5d1bcc046f3b8c38--