[resolved] How use cMessageRouter?

Highlighted
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
    Highlighted
    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.

    View solution in original post


    All Replies
    Highlighted
    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.

    View solution in original post

    Highlighted
    Four Stars

    Re: [resolved] How use cMessageRouter?

    Ok,
    your solution works great.
    thx

    2019 GARTNER 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

    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