Writing a custom data type converter
If you find that you have written one or more processors that are just casting or converting from one data type to another, then writing a custom Camel Type Converter will help you reduce that boilerplate code. Camel attempts to automatically convert from one data type to another within a route, and allows you to extend its type converter registry with converters between known types.
The Type Converters are like cast operations in Java. If you want to do a more complex data format change, say from XML to JSON, then you should look at Chapter 4, Transformation, Camel's built in Data Format Marshallers (http://camel.apache.org/data-format.html), and the Writing a Custom Data Marshaller recipe.
This recipe will show you how to create and register a custom Type Converter that Camel will use to automatically convert those specified data types.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.extend.typeconverter
package. The Spring...