Mapping the message to method parameters

Camel provides a capability called Parameter Binding, which allows your route to explicitly map parts of the message to your method parameters when Camel invokes a Java method. This can be used anywhere you can use the Bean or Method Expression Languages, such as in a predicate, processor step, or expression.

This recipe will show you how to specify the mapping of the exchange values to your method parameters right within the DSL.

Getting ready

The Java code for this recipe is located in the org.camelcookbook.extend.binding package. The Spring XML files are located under src/main/resources/META-INF/spring and prefixed with binding.

This recipe assumes the existence of a Java class with the following definition, ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.