Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
Using a processor in a route
Once you have written a class which implements processor like this...
You can then easily use this inside a route by declaring the bean in Spring, say via the XML (or registering it in JNDI if that is your Registry)
Then in Camel you can do
Using the process DSL
In your route you can also use the
If you need to lookup the processor in the Registry then you should use the processRef DSL:
Why use process when you can use to instead?
The process can be used in routes as an anonymous inner class such:
This is usable for quickly whirling up some code. If the code in the inner class gets a bit more complicated it is of course advised to refactor it into a separate class.
Turning your processor into a full Component