I am new to Apache camel. Does anyone know how to use camel to process the content of a text file to check if a particular string e.g "error" is present within a text file. I cant seem to go past the first line below with java. Any help will be appreciated
from("file://inputdir/").convertBodyTo(String.class).
Use bodyAs
and contains
. For example:
from("file://inputdir/")
.choice()
.when(bodyAs(String.class).contains("error"))
.to(/* a route for errors */)
.otherwise()
.to(/* a route for non-errors */);