Apache Camel: do Processors and Beans serve the same purpose?

redben picture redben · May 19, 2011 · Viewed 15.5k times · Source

It seems like both serve the same purpose. Is there any difference that makes one useful in certain situations and not the other ?

Answer

Ben ODay picture Ben ODay · May 20, 2011

In practice, they are very similar, but a Processor is more limited than a Bean. I generally use a Processor for simple use cases that just interact with the Exchange. Also, inline processors are a great way to interact without having to create a separate class.

Beans provide more flexibility and also support a true POJO approach. This allows you to more easily integrate with existing APIs (just need to convert the inputs/outputs to match, etc).

Beans also provide great features/flexibility with regards to Camel routing/EIP integration, including...