Apache Camel — Message Filter

How can a component avoid receiving uninteresting messages?

The Message Filter from the EIP patterns allows you to filter messages

//Java Bean to add the business logic
public static class MyBean {
public boolean isGoldCustomer(@Header(“level”) String level) {
return level.equals(“gold”);
//Configuration to filter 
<bean id=”myBean” class=”com.foo.MyBean”/>
<camelContext xmlns=”http://camel.apache.org/schema/spring">
<from uri=”direct:a”/>
<method ref=”myBean” method=”isGoldCustomer”/>
<to uri=”direct:b”/>


One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.