You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vcamel9 <vc...@outlook.com> on 2017/03/19 13:23:26 UTC

Pass the properties for each request coming between the route definitions

I am unable to pass properties using setProperty or setheader Please see
below? What is the best way? 
I tried both ways(with header and property) but restlet uri definition is
not able to find the property value for .   

<camelContext id="camel-orchestration"
xmlns="http://camel.apache.org/schema/spring">
         <route id="_inputQRoute">
            <from id="camelQListener" uri="jmsamq:queue:abcInputQ"/>
            <setProperty
propertyName="orderidInfo"><xpath>//orderid/text()</xpath></setProperty>
              
            <log message="Routed ${orderid} to Test queue"/>
            <recipientList id="dispatchToRoute">
                <simple>direct:abcRoute</simple>
            </recipientList>
        </route>
        
        <route id="abcRoute">
            <from id="abcRouteStarter" uri="direct:abcRoute"/>
            <to id="restServiceCall"
uri="restlet:http://host:8080/ordDataPersist/order/orderData/getOrderData/${orderid}"/>
            <to id="_to1" uri="log:output"/>
            <to id="_to2" uri="direct:otherRoute"/>
        </route>
        

   I have to use pass the properties for each request coming between the
route definitions. Anyone please let me know the best way to do it. 
 



--
View this message in context: http://camel.465427.n5.nabble.com/Pass-the-properties-for-each-request-coming-between-the-route-definitions-tp5795777.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Pass the properties for each request coming between the route definitions

Posted by Taariq Levack <ta...@gmail.com>.
You're looking for "dynamic to", depending on your Camel version you may
have to use the recipient list eip instead.

See this faq
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

Cheers,
Taariq

On 19 Mar 2017 3:23 PM, "vcamel9" <vc...@outlook.com> wrote:

I am unable to pass properties using setProperty or setheader Please see
below? What is the best way?
I tried both ways(with header and property) but restlet uri definition is
not able to find the property value for .

<camelContext id="camel-orchestration"
xmlns="http://camel.apache.org/schema/spring">
         <route id="_inputQRoute">
            <from id="camelQListener" uri="jmsamq:queue:abcInputQ"/>
            <setProperty
propertyName="orderidInfo"><xpath>//orderid/text()</xpath></setProperty>

            <log message="Routed ${orderid} to Test queue"/>
            <recipientList id="dispatchToRoute">
                <simple>direct:abcRoute</simple>
            </recipientList>
        </route>

        <route id="abcRoute">
            <from id="abcRouteStarter" uri="direct:abcRoute"/>
            <to id="restServiceCall"
uri="restlet:http://host:8080/ordDataPersist/order/orderData/getOrderData/${
orderid}"/>
            <to id="_to1" uri="log:output"/>
            <to id="_to2" uri="direct:otherRoute"/>
        </route>


   I have to use pass the properties for each request coming between the
route definitions. Anyone please let me know the best way to do it.




--
View this message in context: http://camel.465427.n5.nabble.
com/Pass-the-properties-for-each-request-coming-between-
the-route-definitions-tp5795777.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Pass the properties for each request coming between the route definitions

Posted by Claus Ibsen <cl...@gmail.com>.
Use { } in the restlet uri as it supports REST placeholders.

And then use a header for the orderId as that is what { } refers to.

An alternative is to use dynamic-to which works for any Camel endpoint
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

On Sun, Mar 19, 2017 at 2:23 PM, vcamel9 <vc...@outlook.com> wrote:
> I am unable to pass properties using setProperty or setheader Please see
> below? What is the best way?
> I tried both ways(with header and property) but restlet uri definition is
> not able to find the property value for .
>
> <camelContext id="camel-orchestration"
> xmlns="http://camel.apache.org/schema/spring">
>          <route id="_inputQRoute">
>             <from id="camelQListener" uri="jmsamq:queue:abcInputQ"/>
>             <setProperty
> propertyName="orderidInfo"><xpath>//orderid/text()</xpath></setProperty>
>
>             <log message="Routed ${orderid} to Test queue"/>
>             <recipientList id="dispatchToRoute">
>                 <simple>direct:abcRoute</simple>
>             </recipientList>
>         </route>
>
>         <route id="abcRoute">
>             <from id="abcRouteStarter" uri="direct:abcRoute"/>
>             <to id="restServiceCall"
> uri="restlet:http://host:8080/ordDataPersist/order/orderData/getOrderData/${orderid}"/>
>             <to id="_to1" uri="log:output"/>
>             <to id="_to2" uri="direct:otherRoute"/>
>         </route>
>
>
>    I have to use pass the properties for each request coming between the
> route definitions. Anyone please let me know the best way to do it.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Pass-the-properties-for-each-request-coming-between-the-route-definitions-tp5795777.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2