Camel routes in Spring config file

时间:2024-08-22 15:33:32

The normal spring bean definition configuration file, the xsi:schemaLocation only has two: beans and spring-beans.xsd. To define camelContext in spring config file, another two should be added: spring and camel-spring-correlate.xsd. And in <camelContext>, pls specify xmlns=http://camel.apache.org/schema/spring.

Most of the time, you need to maintain routes in different xml files, so you could define <routeContext> will routes, and in the spring config with <camelContext>, import that xml file, and include <routeContextRef>.

In camelContext, you could define proxy which simulate producer by java interfaces. The object passed in is a BeanInvocationObject with those parameters.