无法启动从外部XML加载的Camel Routes

时间:2017-01-07 03:20:18

标签: java spring apache-camel

我在文件中有Camel路由' CamelRoute.xml'

oshi-project:oshi-core:1.1

以下是我在路线上方加载的代码。试图运行

<routes xmlns="http://camel.apache.org/schema/spring">
   <route startupOrder="1">
    <from uri="file:D:\Work\eclipse_workspace\dataEngine_GIT_2\src\data" />
      <unmarshal>
        <csv delimiter="|" quoteDisabled="true" />
    </unmarshal>
    <to uri="bean:csvProcessor?method=processNew" />
</route>

</routes>

但路线没有开始。

是我遗漏的东西?

CamelContext camelContext = new SpringCamelContext(); Resource resource= new FileSystemResource("F:\\GIT\\data_acquisition\\src\\main\\resources\\CamelRoute.xml"); InputStream is = resource.getInputStream(); RoutesDefinition routes = camelContext.loadRoutesDefinition(is); camelContext.addRouteDefinitions(routes.getRoutes()); camelContext.startAllRoutes(); 失踪

0 个答案:

没有答案