我是 Apache Camel 的新手。有谁知道如何使用驼峰处理文本文件的内容来检查文本文件中是否存在特定字符串,例如“错误”。我似乎无法用 java 跳过下面的第一行。任何帮助将不胜感激
from("file://inputdir/").convertBodyTo(String.class).
最佳答案
from("file://inputdir/")
.choice()
.when(bodyAs(String.class).contains("error"))
.to(/* a route for errors */)
.otherwise()
.to(/* a route for non-errors */);
关于java - 如何使用 Apache Camel 在文本文件中搜索字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44635265/