Custom DataFormat

You can use your custom Data Format implementation with Camel. All you have to do is to implement the DataFormat interface. For example in the following we will implement a reverse data format as shown below:

Custom implementation of DataFormat that reverses data

And to use it in Java DSL:

Notice we use custom to refer to the Data Format in the Registry. In Java DSL you can also provide the instance directly as shown:

And likewise to use it in XML DSL:

Notice in the XML DSL example above we use <custom> to refer to a custom data format. This requires Camel 2.8 or better. In older releases you would have to use the ref attribute as shown below. Notice the ref attribute has been @deprecated and you should prefer to use the <custom> way:

See Also

© 2004-2014 The Apache Software Foundation.
Apache Camel, Camel, Apache, the Apache feather logo, and the Apache Camel project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram