Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[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,
    Labels (3)
    1 Solution

    Accepted Solutions
    Anonymous
    Not applicable
    Author

    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

    2 Replies
    Anonymous
    Not applicable
    Author

    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.
    Anonymous
    Not applicable
    Author

    Ok,
    your solution works great.
    thx