我有一个Spring Boot应用程序,我正在添加一个camel路由。定义路由的类扩展了FatJarRouter,并带有@Component注释。当应用程序作为Spring Boot应用程序运行时,路由未被识别。但是,如果我在带有@SpringBootApplication注释的主类中编写路由,则路由将被识别。目前,日志显示如下:
请告诉我如何在单独的类中编写路由并标识它,而不是在主类中。是否有什么遗漏?
o.a.camel.spring.SpringCamelContext:共计0条路由,其中0条已启动。 o.a.camel.spring.SpringCamelContext:Apache Camel 2.17.2(CamelContext:camel-4)在0.026秒内启动。
具有路由的方法还使用override进行了注释:@Override
public void configure() throws Exception{
from("file:\\input").to("file:\\output");
}
请告诉我如何在单独的类中编写路由并标识它,而不是在主类中。是否有什么遗漏?