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

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top