Not all messages are interesting and worth processing. Some applications generate too much noise, and only messages matching criteria should continue down a pipeline. In these kind of situations Message Filter pattern is used to eliminate undesirable messages, as shown in the following figure:
The complete source code for this tutorial is located under the following project:
Start with a filter definition, followed by a predicate expression and the processors to which this filter applies:
from("direct:start") .filter(header("userStatus").isEqualTo("valid")) ...