已在以下应用程序代码中注册了Guava-Eventbus端点
SimpleRegistry registry = new SimpleRegistry();
EventBus eventBus = new EventBus();
registry.put("busName", eventBus);
CamelContext camel = new DefaultCamelContext(registry);
eventBus.post("Send me to the SEDA queue.");
并将所需的Camel端点添加到configure()
中from("guava-eventbus:busName").to("seda:queue");
通过Spring Boot应用程序控制台运行此操作时,获取以下异常。有人可以帮忙
org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[guava-eventbus:camelTest]] -> [Log[Examp... because of No bean could be found in the registry for: camelTest of type: com.google.common.eventbus.EventBus
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1831) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) ~[camel-spring-2.20.0.jar:2.20.0]
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:174) ~[camel-spring-2.20.0.jar:2.20.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) ~[spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.4.RELEASE.jar:1.5.4.RELEASE]
at com.camel.guava.eventbus.App.main(App.java:10) [classes/:na]
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route1: Route(route1)[[From[guava-eventbus:camelTest]] -> [Log[Examp... because of No bean could be found in the registry for: camelTest of type: com.google.common.eventbus.EventBus
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:147) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:3932) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3839) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:3625) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3477) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:208) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3236) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3255) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3232) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3155) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:133) ~[camel-spring-2.20.0.jar:2.20.0]
... 15 common frames omitted
Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: camelTest of type: com.google.common.eventbus.EventBus
at org.apache.camel.util.CamelContextHelper.mandatoryLookup(CamelContextHelper.java:189) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.component.guava.eventbus.GuavaEventBusEndpoint.doStart(GuavaEventBusEndpoint.java:135) ~[camel-guava-eventbus-2.20.0.jar:2.20.0]
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:157) ~[camel-core-2.20.0.jar:2.20.0]
at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145) ~[camel-core-2.20.0.jar:2.20.0]
... 27 common frames omitted