...
Code Block |
---|
<route> <from uri="direct:convertOrder"/> <process ref="converter"/> </route> <bean id="converter" class="com.mycompany. OrderConvertProcessor"/> |
...
XML DSL Java Bean Example
Instead of the processor option (shown above), we can also use a POJO bean option. The advantage of using a POJO bean over a processor is that we don’t have to implement any Camel-specific interfaces or types. This type of implementation will allow us to fully decouple your beans from Camel.
Code Block |
---|
public class OrderConvertBean {
public StringconvertOrder(String body) {
// do message translation here
}
}
Object transformer = new OrderConvertBean();
from("direct:convertOrder").bean(transformer);
|
Using the following Bean definition:
...