我在文件中有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();
失踪