[resolved] Camel Routing on file name : startsWith equivalent

Hello, i am trying to set a routing condition over a file name : if the file name starts with a given pattern, it goes to Endpoint1, otherwise it goes to endpoint 2.
Is it possible to do something like a "startsWith" condition using Camel , on a CMessageRouter ?
I would like to do something like "${header.CamelFileNameOnly}.startsWith('test1_')" on my "when" condition, but for now it is not working.
If someone got a hint for me, i'll be glad to take it.
1 REPLY
One Star

Re: [resolved] Camel Routing on file name : startsWith equivalent

Hello,
What about using .contains("") ?
It's not the same as a String function but you could do a startWith on the String (camel.CamelFileNameOnly) after the messagerouter in a processor so you're sure you're doing it right. I don't see any other option atm.
Maybe consider asking these camel questions on the camel mailing list.(Without mentionning any vendor Smiley Happy)