在第一次拼写错误之后,我想要为我的谓词表达式输入支持。于是转向
header(Exchange.FILE_NAME)
如...
from("file://src/test/resources/routingtodifferentdestinations-source?noop=true")//
.choice()//
.when(header(Exchange.FILE_NAME).contains("widget.txt"))//
(Q) 该 API 中“header.in”和“header.out”之间的区别在哪里/如何发生。
以简单方式编写的等效情况,其中 in.header 和 out.header 之间的区别明确:
simple("${in.header.CamelFileName} contains 'widget.txt'"
谢谢
最佳答案
你真的不需要关心 IN 与 OUT。始终使用 IN 即可。或者更好的是根本不使用 in,因为这是暗示的,例如 ${in.headers.foo} 与 ${headers.foo} 相同。
查看此常见问题解答 http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
关于java - Apache Camel 中的 header 谓词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21572069/