You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Deepthi <de...@gmail.com> on 2012/08/08 05:15:35 UTC

How to set parameter dynamically in uri

Hi,

I am trying to set parameter dynamically in uri in the following manner:
              <camel:route>
                        <camel:from
                                uri="file://[folder path]" />
                        <camel:setHeader headerName="id">
                                       
<camel:xpath>/order/item/id</camel:xpath>
                        </camel:setHeader>
                        <camel:to
                               
uri="http://localhost:9002/rest/{id}/RestService" />
                </camel:route> 

Is this the right way to set the parameter? If not, how can I achieve this?
I am using camel 2.8.0.




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-set-parameter-dynamically-in-uri-tp5716959.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to set parameter dynamically in uri

Posted by Deepthi <de...@gmail.com>.
Thanks Michal.
This works.



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-set-parameter-dynamically-in-uri-tp5716959p5717001.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to set parameter dynamically in uri

Posted by "michal.warecki" <mi...@gmail.com>.
You can use recipient list with simple language i.e.:

<camel:recipientList>
   
<camel:simple>http://localhost:9002/rest/${header.id}/RestService</camel:simple>
</camel:recipientList>



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-set-parameter-dynamically-in-uri-tp5716959p5716971.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to set parameter dynamically in uri

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the FAQ
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

On Wed, Aug 8, 2012 at 5:15 AM, Deepthi <de...@gmail.com> wrote:
> Hi,
>
> I am trying to set parameter dynamically in uri in the following manner:
>               <camel:route>
>                         <camel:from
>                                 uri="file://[folder path]" />
>                         <camel:setHeader headerName="id">
>
> <camel:xpath>/order/item/id</camel:xpath>
>                         </camel:setHeader>
>                         <camel:to
>
> uri="http://localhost:9002/rest/{id}/RestService" />
>                 </camel:route>
>
> Is this the right way to set the parameter? If not, how can I achieve this?
> I am using camel 2.8.0.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-set-parameter-dynamically-in-uri-tp5716959.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen