[resolved] How use cMessageRouter?

Four Stars

[resolved] How use cMessageRouter?

Hi,

I try to do a message router with talend ESB :

from("direct:start")
   .choice()
        .when(header("foo").startsWith("ba"))
            .log("je passe par le when")
            .to("direct:when")
        .otherwise()
            .log("je passe par le otherwise")
            .to("direct:other");

I could do it with a "javaDSL" but I'd like to use a "cMessageRouter".
How works the component cMessageRouter?
How generate a "when(Predicate)" and not a "when().language(…)"?

My environment :
[list=*]
  • Windows 7

  • Talend Open Studio version 5.6.0



  • Thanks,

    Accepted Solutions
    Employee

    Re: [resolved] How use cMessageRouter?

    Hi,

    You could use cMessageRouter component but with simple language condition like this:
    "${headers.foo} regex '^ba.*'"

    Currently the Studio is not able to generate code to support
    when(header("foo").startsWith("ba"))

    but cMessageRoute + simple language would solve your use case above.

    Regards.

    All Replies
    Employee

    Re: [resolved] How use cMessageRouter?

    Hi,

    You could use cMessageRouter component but with simple language condition like this:
    "${headers.foo} regex '^ba.*'"

    Currently the Studio is not able to generate code to support
    when(header("foo").startsWith("ba"))

    but cMessageRoute + simple language would solve your use case above.

    Regards.
    Four Stars

    Re: [resolved] How use cMessageRouter?

    Ok,
    your solution works great.
    thx

    15TH OCTOBER, COUNTY HALL, LONDON

    Join us at the Community Lounge.

    Register Now

    2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

    Talend named a Leader.

    Get your copy

    OPEN STUDIO FOR DATA INTEGRATION

    Kickstart your first data integration and ETL projects.

    Download now

    What’s New for Talend Summer ’19

    Watch the recorded webinar!

    Watch Now

    Talend API Designer – Technical Overview

    Take a look at this technical overview video of Talend API Designer

    Watch Now

    Getting Started with APIs

    Find out how to get started with APIs

    Read