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: how to get .Choice().When to continue ?
Date Thu, 31 Jul 2014 07:05:34 GMT
Hi

See recipient list

On Thu, Jul 31, 2014 at 8:46 AM, Frankiboy <mail.to.frankj@gmail.com> wrote:
> Not nice, than i have to copy the same 3 lines 3 times in my code....
>
> Is there not a better solution to this...
>
>
>    from("direct:channel1")
>        .bean(SetRoutingKey.class)
>        .choice()
>        .when(header(ROUTING_KEY).contains(ROUTING_HREG_BD)).setHeader("BD",
> constant("YES"))
>         .setHeader("JMS_IBM_Format", constant("MQSTR"))
>        .bean(LogMq.class, "logStart")
>        .inOnly("activemq:topic:HUB_TOP01")
>        .when(header(ROUTING_KEY).contains(ROUTING_HREG_BEC)).setHeader("BD",
> constant("YES"))
>         .setHeader("JMS_IBM_Format", constant("MQSTR"))
>        .bean(LogMq.class, "logStart")
>        .inOnly("activemq:topic:HUB_TOP01")
>        .when(header(ROUTING_KEY).contains(ROUTING_HREG_SDC)).setHeader("BD",
> constant("YES"))
>        .setHeader("JMS_IBM_Format", constant("MQSTR"))
>        .bean(LogMq.class, "logStart")
>        .inOnly("activemq:topic:HUB_TOP01");
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-to-get-Choice-When-to-continue-tp5754682p5754708.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message