Camel routes in Spring config file

Posted on 2013-08-12 19:30  chayu3  阅读(256)  评论(0编辑  收藏  举报

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.