camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Camel routing DSL - Questions
Date Mon, 15 Apr 2013 15:33:57 GMT
Hi

And for #3 you can use the dynamic router,
or recipient list, and call a method on a bean instead.  Then you
don't need 85 when's in the content based router, that is too much. eg
just as in regular java code, you do not want to have 85 x if .. else.

On Mon, Apr 15, 2013 at 4:43 PM, prabumca06@gmail.com
<prabumca06@gmail.com> wrote:
> Question:1
>
> I am having code like blow.based on condition i want forward into dynamic
> queue.
>
>  .when(header(TYPE).isNotNull())
>   .recipientList(simple("activemq:queue:Inbound.${header.TYPE}"))
>
> i want to use .to(simple ) insight of .recipientList(simple)
>
> Please suggest is it possible?.why it is not possible is there any
> performance issue if i use .recipientList(simple)
>
> Question:2
>
> Error in code
>
> from(INBOUND_QUEUE)
> .choice().when(header(TYPE).isNotNull())
>   .recipientList(simple("activemq:queue:Inbound.${header.TYPE}"))
> .otherwise()
>    .to(ERQ_QNAME)
> .endChoice();
>
> After execute i am getting following error.
>
> Error:
>
> Router.java:22: cannot find symbol
> symbol  : method otherwise()
> location: class
> org.apache.camel.model.RecipientListDefinition<org.apache.camel.
> model.ChoiceDefinition>
>            .otherwise()
>            ^
>
> Question:3
>
> I having more than 85 queues.Based on condition i want to forward to correct
> queue.
>
> In my route builder i having code below for all 85 queus.
>
>   from(ALERT_QNAME).choice()
>           .when(ALERT_PREDICATE).to(ALERT_QNAME)
>           .otherwise()
>           .to(ERQ_QNAME)
>  .end();
>
> I feel like because of my code performance getting degrade.Please suggest if
> i am wrong?
>
> When i open jconsole i am getting white screen and queues some time not
> showing any attribute?
>
> Please kindly help me.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-DSL-Questions-tp5730917.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message