Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Header Predicate in Apache Camel

After first misspelling i wanted typed support for my predicate expression. So turned to

header(Exchange.FILE_NAME) 

as in ...

from("file://src/test/resources/routingtodifferentdestinations-source?noop=true")//
.choice()//
.when(header(Exchange.FILE_NAME).contains("widget.txt"))//

(Q) Where/How happens the distinction between "header.in" and "header.out" in that API.

The equivalent case written in simple, where the distinction is made between in.header and out.header is made explicit:

simple("${in.header.CamelFileName} contains 'widget.txt'"

Thanks

like image 420
Joerg M. Avatar asked Dec 31 '25 20:12

Joerg M.


1 Answers

You dont need to concern about IN vs OUT really. Just use IN always. Or better yet do not use in at all, as that is implied, eg ${in.headers.foo} is the same as ${headers.foo}.

See this FAQ http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

like image 129
Claus Ibsen Avatar answered Jan 03 '26 10:01

Claus Ibsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!