You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jagannath Naidu <ja...@fosteringlinux.com> on 2016/03/25 08:22:25 UTC

Issue with dynamic uri

Hi List,

I have been trying to configure dynamic uri but could not find a relevant
way to complete this task. Below is the problem description.


1. Client 1 posts to ROUTE 1 and waits for a response
2. ROUTE 1 uses pollenrich and polls a queue (SECOND) and gets a specific
message  using selector "head='jagan'".

3. ROUTE 2 and ROUTE 3 are InOnly routes
4. ROUTE 2 sets header head:naidu and sends to queue SECOND
5. ROUTE 3 sets header head:jagan and sends to queue SECOND

6. ROUTE 1 users static uri "activemq:queue:SECOND?selector=head='jagan'"

Problem:
I want this to be dynamic. I want set this dynamically using the exchange
posted by client.

I followed this
http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html.
But I could not find a relevant consumer template working example.  Please
advice.

##############################################
1. ROUTE 1
##############################################
blueprint.xml

<bean id="myStrat" class="org.bean.test.MyStrat"/>

<camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint">

<route id="TO QUEUE ONE">
        <from uri="restlet:http://127.0.0.1:1230/qqq?restletMethod=POST"/>
        <setHeader headerName="dynamic"><simple>jagan</simple></setHeader>
        <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
strategyRef="myStrat" timeout="30000"/>
</route>
</camelContext>

MyStrat.java

public class MyStrat implements AggregationStrategy {
        Logger log = Logger.getLogger(MyStrat.class);
    public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
        if (oldExchange == null) {
            return newExchange;
        }
        String newBody = newExchange.getIn().getBody(String.class);
        log.info("Hello 1" + newBody);
        String oldBody = oldExchange.getIn().getBody(String.class);
        log.info("hello 2" + oldBody);
        newExchange.getIn().setBody(newBody);
        log.info("hello 3" + newBody);
        return newExchange;
##########################################################################
ROUTE 2
##########################################################################
blueprint.xml

<camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint">
<route id="jetty1-1">
          <from uri="restlet:http://127.0.0.1:1236/abc?restletMethod=POST"/>
        <setExchangePattern pattern="InOnly"/>
        <setHeader headerName="head"><simple>naidu</simple></setHeader>
        <to uri="activemq:queue:SECOND"/>
</route>
</camelContext>
########################################################################
ROUTE 3
########################################################################
blueprint.xml

<camelContext id="jetty1" xmlns="http://camel.apache.org/schema/blueprint">
<route id="jetty1-1">
          <from uri="restlet:http://127.0.0.1:1237/abc?restletMethod=POST"/>
        <setExchangePattern pattern="InOnly"/>
        <setHeader headerName="head"><simple>jagan</simple></setHeader>
        <to uri="activemq:queue:SECOND"/>
</route>
</camelContext>









-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006

Re: Issue with dynamic uri

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

Good to hear. But mind the consumer template should be created once
and re-used ideally.
http://camel.apache.org/why-does-camel-use-too-many-threads-with-producertemplate.html

If not you need to stop it after use so it can cleanup.



On Sat, Mar 26, 2016 at 6:03 AM, Jagannath Naidu
<ja...@fosteringlinux.com> wrote:
> Hi Claus,
>
> !!@#$@  it worked :-D. Thank you very much
>
> Below is what I am using.
>
>     Logger log = Logger.getLogger(JettyRoute.class.getName());
>
>     DynamicPollEnricher pollEnricher = new DynamicPollEnricher();
>
> public String process(Exchange exchange) throws Exception {
> log.info("START");
> // TODO Auto-generated method stub
> ConsumerTemplate consumerTemplate =
> exchange.getContext().createConsumerTemplate();
> String headVal = (String)exchange.getIn().getHeader("dynamic");
> String enrichURI = "activemq:queue:SECOND?selector=head='"+headVal+"'";
> log.info("HELOO " + headVal + " H " + enrichURI);
> /*ExchangeHelper.*/
> Exchange answer = consumerTemplate.receive(enrichURI, 20000);
> log.info("Received Exchange Body:  "+answer.getIn().getBody(String.class));
> log.info("Received Exchange MessageId:  "+answer.getIn().getMessageId());
> String a = answer.getIn().getBody(String.class);
> return a;
> }
>
>
>
>
>
> On 25 March 2016 at 19:10, Claus Ibsen <cl...@gmail.com> wrote:
>
>> You can use a processor (or bean) - the code below is pseudo written
>> in the email
>>
>> process(Exchange exchange) {
>> // use simple to build the dynamic uri
>> String uri =
>> exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
>> String.class);
>>
>> // create polling consumer to poll the message
>> PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
>> pc.start();
>> try {
>> Exchange out = pc.receive(30000);
>> if (out != null) {
>>    .. merge from out into current exchange
>>     Object newBody = out.getIn().getBody();
>>     Object oldBody = exchange.getIn().getBody();
>>     .. merge like you want to do in that strategy class.
>>     .. or you can use the strategy here
>>    // done out
>>   out.getUnitOfWork().done(out);
>> } finally {
>> pc.stop();
>> }
>>
>> On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
>> <ja...@fosteringlinux.com> wrote:
>> > Thanks Claus,
>> >
>> > I came here for help after reading this link
>> >
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> > .
>> > And I am fairly new to camel, would you mind sharing some/any sample code
>> > for this.
>> > Thank you very much.
>> >
>> > On 25 March 2016 at 13:35, Claus Ibsen <cl...@gmail.com> wrote:
>> >
>> >> If you are stuck on Camel 2.15.x you would need to write some java
>> >> code where you build the uri and use a consumer template to poll. And
>> >> do the enrichment from the java code.
>> >>
>> >>
>> >>
>> >> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
>> >> <ja...@fosteringlinux.com> wrote:
>> >> > Thank you fabrizio.
>> >> >
>> >> > But the issue is with passing dynamic uri to pollenrich.
>> >> >
>> >> > On 25 March 2016 at 13:25, fabrizio.spataro <
>> fabrizio.spataro@bizmate.it
>> >> >
>> >> > wrote:
>> >> >
>> >> >> Hello,
>> >> >>
>> >> >> abstractly dynamic uri can be do it using recipientList + simple
>> >> leanguage
>> >> >>
>> >> >>
>> >> > http://camel.apache.org/content-enricher.html
>> >> > says, you can use something like
>> >> > <route>
>> >> >   <from uri="direct:start"/>
>> >> >   <pollEnrich>
>> >> >     <simple>seda:${header.name}</simple>
>> >> >   </pollEnrich>
>> >> >   <to uri="direct:result"/>
>> >> > </route>
>> >> >
>> >> > But I am restricted to use 2.15 only
>> >> >
>> >> > example here: http://camel.apache.org/recipient-list.html
>> >> >>
>> >> >> I want to replace this line
>> >> >
>> >> >         <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
>> >> > strategyRef="myStrat" timeout="30000"/>
>> >> >
>> >> > With something like this
>> >> >
>> >> >         <pollEnrich
>> uri="activemq:queue:SECOND?selector=${header.head}"
>> >> > strategyRef="myStrat" timeout="30000"/>
>> >> >
>> >> >
>> >>
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> >> > says it is possible with an alternative, but I am still clueless. I am
>> >> > fairly new to camel usage.
>> >> >
>> >> >
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Thanks & Regards
>> >> >
>> >> > B Jagannath
>> >> > Keen & Able Computers Pvt. Ltd.
>> >> > +919871324006
>> >>
>> >>
>> >>
>> >> --
>> >> Claus Ibsen
>> >> -----------------
>> >> http://davsclaus.com @davsclaus
>> >> Camel in Action 2: https://www.manning.com/ibsen2
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks & Regards
>> >
>> > B Jagannath
>> > Keen & Able Computers Pvt. Ltd.
>> > +919871324006
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006



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

Re: Issue with dynamic uri

Posted by Jagannath Naidu <ja...@fosteringlinux.com>.
Hi Claus,

!!@#$@  it worked :-D. Thank you very much

Below is what I am using.

    Logger log = Logger.getLogger(JettyRoute.class.getName());

    DynamicPollEnricher pollEnricher = new DynamicPollEnricher();

public String process(Exchange exchange) throws Exception {
log.info("START");
// TODO Auto-generated method stub
ConsumerTemplate consumerTemplate =
exchange.getContext().createConsumerTemplate();
String headVal = (String)exchange.getIn().getHeader("dynamic");
String enrichURI = "activemq:queue:SECOND?selector=head='"+headVal+"'";
log.info("HELOO " + headVal + " H " + enrichURI);
/*ExchangeHelper.*/
Exchange answer = consumerTemplate.receive(enrichURI, 20000);
log.info("Received Exchange Body:  "+answer.getIn().getBody(String.class));
log.info("Received Exchange MessageId:  "+answer.getIn().getMessageId());
String a = answer.getIn().getBody(String.class);
return a;
}





On 25 March 2016 at 19:10, Claus Ibsen <cl...@gmail.com> wrote:

> You can use a processor (or bean) - the code below is pseudo written
> in the email
>
> process(Exchange exchange) {
> // use simple to build the dynamic uri
> String uri =
> exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
> String.class);
>
> // create polling consumer to poll the message
> PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
> pc.start();
> try {
> Exchange out = pc.receive(30000);
> if (out != null) {
>    .. merge from out into current exchange
>     Object newBody = out.getIn().getBody();
>     Object oldBody = exchange.getIn().getBody();
>     .. merge like you want to do in that strategy class.
>     .. or you can use the strategy here
>    // done out
>   out.getUnitOfWork().done(out);
> } finally {
> pc.stop();
> }
>
> On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
> <ja...@fosteringlinux.com> wrote:
> > Thanks Claus,
> >
> > I came here for help after reading this link
> >
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> > .
> > And I am fairly new to camel, would you mind sharing some/any sample code
> > for this.
> > Thank you very much.
> >
> > On 25 March 2016 at 13:35, Claus Ibsen <cl...@gmail.com> wrote:
> >
> >> If you are stuck on Camel 2.15.x you would need to write some java
> >> code where you build the uri and use a consumer template to poll. And
> >> do the enrichment from the java code.
> >>
> >>
> >>
> >> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
> >> <ja...@fosteringlinux.com> wrote:
> >> > Thank you fabrizio.
> >> >
> >> > But the issue is with passing dynamic uri to pollenrich.
> >> >
> >> > On 25 March 2016 at 13:25, fabrizio.spataro <
> fabrizio.spataro@bizmate.it
> >> >
> >> > wrote:
> >> >
> >> >> Hello,
> >> >>
> >> >> abstractly dynamic uri can be do it using recipientList + simple
> >> leanguage
> >> >>
> >> >>
> >> > http://camel.apache.org/content-enricher.html
> >> > says, you can use something like
> >> > <route>
> >> >   <from uri="direct:start"/>
> >> >   <pollEnrich>
> >> >     <simple>seda:${header.name}</simple>
> >> >   </pollEnrich>
> >> >   <to uri="direct:result"/>
> >> > </route>
> >> >
> >> > But I am restricted to use 2.15 only
> >> >
> >> > example here: http://camel.apache.org/recipient-list.html
> >> >>
> >> >> I want to replace this line
> >> >
> >> >         <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
> >> > strategyRef="myStrat" timeout="30000"/>
> >> >
> >> > With something like this
> >> >
> >> >         <pollEnrich
> uri="activemq:queue:SECOND?selector=${header.head}"
> >> > strategyRef="myStrat" timeout="30000"/>
> >> >
> >> >
> >>
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> >> > says it is possible with an alternative, but I am still clueless. I am
> >> > fairly new to camel usage.
> >> >
> >> >
> >> >>
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >>
> >>
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> >> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Thanks & Regards
> >> >
> >> > B Jagannath
> >> > Keen & Able Computers Pvt. Ltd.
> >> > +919871324006
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> >
> > B Jagannath
> > Keen & Able Computers Pvt. Ltd.
> > +919871324006
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006

Re: Issue with dynamic uri

Posted by Claus Ibsen <cl...@gmail.com>.
You can use a processor (or bean) - the code below is pseudo written
in the email

process(Exchange exchange) {
// use simple to build the dynamic uri
String uri = exchange.getContext().resolveLanguage("simple").evaluate("activemq:queue:SECOND?selector=${header.head}",
String.class);

// create polling consumer to poll the message
PollingConsumer pc = exchange.getEndpoint(uri).createPollingConsumer();
pc.start();
try {
Exchange out = pc.receive(30000);
if (out != null) {
   .. merge from out into current exchange
    Object newBody = out.getIn().getBody();
    Object oldBody = exchange.getIn().getBody();
    .. merge like you want to do in that strategy class.
    .. or you can use the strategy here
   // done out
  out.getUnitOfWork().done(out);
} finally {
pc.stop();
}

On Fri, Mar 25, 2016 at 9:24 AM, Jagannath Naidu
<ja...@fosteringlinux.com> wrote:
> Thanks Claus,
>
> I came here for help after reading this link
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> .
> And I am fairly new to camel, would you mind sharing some/any sample code
> for this.
> Thank you very much.
>
> On 25 March 2016 at 13:35, Claus Ibsen <cl...@gmail.com> wrote:
>
>> If you are stuck on Camel 2.15.x you would need to write some java
>> code where you build the uri and use a consumer template to poll. And
>> do the enrichment from the java code.
>>
>>
>>
>> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
>> <ja...@fosteringlinux.com> wrote:
>> > Thank you fabrizio.
>> >
>> > But the issue is with passing dynamic uri to pollenrich.
>> >
>> > On 25 March 2016 at 13:25, fabrizio.spataro <fabrizio.spataro@bizmate.it
>> >
>> > wrote:
>> >
>> >> Hello,
>> >>
>> >> abstractly dynamic uri can be do it using recipientList + simple
>> leanguage
>> >>
>> >>
>> > http://camel.apache.org/content-enricher.html
>> > says, you can use something like
>> > <route>
>> >   <from uri="direct:start"/>
>> >   <pollEnrich>
>> >     <simple>seda:${header.name}</simple>
>> >   </pollEnrich>
>> >   <to uri="direct:result"/>
>> > </route>
>> >
>> > But I am restricted to use 2.15 only
>> >
>> > example here: http://camel.apache.org/recipient-list.html
>> >>
>> >> I want to replace this line
>> >
>> >         <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
>> > strategyRef="myStrat" timeout="30000"/>
>> >
>> > With something like this
>> >
>> >         <pollEnrich uri="activemq:queue:SECOND?selector=${header.head}"
>> > strategyRef="myStrat" timeout="30000"/>
>> >
>> >
>> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
>> > says it is possible with an alternative, but I am still clueless. I am
>> > fairly new to camel usage.
>> >
>> >
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> >> Sent from the Camel - Users mailing list archive at Nabble.com.
>> >>
>> >
>> >
>> >
>> > --
>> > Thanks & Regards
>> >
>> > B Jagannath
>> > Keen & Able Computers Pvt. Ltd.
>> > +919871324006
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006



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

Re: Issue with dynamic uri

Posted by Jagannath Naidu <ja...@fosteringlinux.com>.
Thanks Claus,

I came here for help after reading this link
http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
.
And I am fairly new to camel, would you mind sharing some/any sample code
for this.
Thank you very much.

On 25 March 2016 at 13:35, Claus Ibsen <cl...@gmail.com> wrote:

> If you are stuck on Camel 2.15.x you would need to write some java
> code where you build the uri and use a consumer template to poll. And
> do the enrichment from the java code.
>
>
>
> On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
> <ja...@fosteringlinux.com> wrote:
> > Thank you fabrizio.
> >
> > But the issue is with passing dynamic uri to pollenrich.
> >
> > On 25 March 2016 at 13:25, fabrizio.spataro <fabrizio.spataro@bizmate.it
> >
> > wrote:
> >
> >> Hello,
> >>
> >> abstractly dynamic uri can be do it using recipientList + simple
> leanguage
> >>
> >>
> > http://camel.apache.org/content-enricher.html
> > says, you can use something like
> > <route>
> >   <from uri="direct:start"/>
> >   <pollEnrich>
> >     <simple>seda:${header.name}</simple>
> >   </pollEnrich>
> >   <to uri="direct:result"/>
> > </route>
> >
> > But I am restricted to use 2.15 only
> >
> > example here: http://camel.apache.org/recipient-list.html
> >>
> >> I want to replace this line
> >
> >         <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
> > strategyRef="myStrat" timeout="30000"/>
> >
> > With something like this
> >
> >         <pollEnrich uri="activemq:queue:SECOND?selector=${header.head}"
> > strategyRef="myStrat" timeout="30000"/>
> >
> >
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> > says it is possible with an alternative, but I am still clueless. I am
> > fairly new to camel usage.
> >
> >
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> >> Sent from the Camel - Users mailing list archive at Nabble.com.
> >>
> >
> >
> >
> > --
> > Thanks & Regards
> >
> > B Jagannath
> > Keen & Able Computers Pvt. Ltd.
> > +919871324006
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006

Re: Issue with dynamic uri

Posted by Claus Ibsen <cl...@gmail.com>.
If you are stuck on Camel 2.15.x you would need to write some java
code where you build the uri and use a consumer template to poll. And
do the enrichment from the java code.



On Fri, Mar 25, 2016 at 9:02 AM, Jagannath Naidu
<ja...@fosteringlinux.com> wrote:
> Thank you fabrizio.
>
> But the issue is with passing dynamic uri to pollenrich.
>
> On 25 March 2016 at 13:25, fabrizio.spataro <fa...@bizmate.it>
> wrote:
>
>> Hello,
>>
>> abstractly dynamic uri can be do it using recipientList + simple leanguage
>>
>>
> http://camel.apache.org/content-enricher.html
> says, you can use something like
> <route>
>   <from uri="direct:start"/>
>   <pollEnrich>
>     <simple>seda:${header.name}</simple>
>   </pollEnrich>
>   <to uri="direct:result"/>
> </route>
>
> But I am restricted to use 2.15 only
>
> example here: http://camel.apache.org/recipient-list.html
>>
>> I want to replace this line
>
>         <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
> strategyRef="myStrat" timeout="30000"/>
>
> With something like this
>
>         <pollEnrich uri="activemq:queue:SECOND?selector=${header.head}"
> strategyRef="myStrat" timeout="30000"/>
>
> http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
> says it is possible with an alternative, but I am still clueless. I am
> fairly new to camel usage.
>
>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Thanks & Regards
>
> B Jagannath
> Keen & Able Computers Pvt. Ltd.
> +919871324006



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

Re: Issue with dynamic uri

Posted by Jagannath Naidu <ja...@fosteringlinux.com>.
Thank you fabrizio.

But the issue is with passing dynamic uri to pollenrich.

On 25 March 2016 at 13:25, fabrizio.spataro <fa...@bizmate.it>
wrote:

> Hello,
>
> abstractly dynamic uri can be do it using recipientList + simple leanguage
>
>
http://camel.apache.org/content-enricher.html
says, you can use something like
<route>
  <from uri="direct:start"/>
  <pollEnrich>
    <simple>seda:${header.name}</simple>
  </pollEnrich>
  <to uri="direct:result"/>
</route>

But I am restricted to use 2.15 only

example here: http://camel.apache.org/recipient-list.html
>
> I want to replace this line

        <pollEnrich uri="activemq:queue:SECOND?selector=head='jagan'"
strategyRef="myStrat" timeout="30000"/>

With something like this

        <pollEnrich uri="activemq:queue:SECOND?selector=${header.head}"
strategyRef="myStrat" timeout="30000"/>

http://camel.465427.n5.nabble.com/pollEnrich-consumer-with-selector-td4939908.html
says it is possible with an alternative, but I am still clueless. I am
fairly new to camel usage.


>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Thanks & Regards

B Jagannath
Keen & Able Computers Pvt. Ltd.
+919871324006

Re: Issue with dynamic uri

Posted by "fabrizio.spataro" <fa...@bizmate.it>.
Hello,

abstractly dynamic uri can be do it using recipientList + simple leanguage

example here: http://camel.apache.org/recipient-list.html







--
View this message in context: http://camel.465427.n5.nabble.com/Issue-with-dynamic-uri-tp5779689p5779690.html
Sent from the Camel - Users mailing list archive at Nabble.com.