Creating API in ApacheCamel JavaDSL.
An error occurred when I tried to use the route of the project I imported in the following steps.
Could you give me some tips on how to solve the problem, such as using other project routes?
·Route part of A project
package jp.co.aaa.route;
public class ARoute extensions RouteBuilder {
@ Override
public void configure()throws Exception {
from ("direct:check")
.routeId ("check")
.transform(simple("${body}"));
}
}
·Calling part of project B
package jp.co.bbb.route;
~~
private void bCheck() {
from ("direct:bcheck")
.routeId ("bcheck")
.to("direct:check");
}
·Add packageScan to the camera-context.xml of project B as follows
<packageScan>
<package>jp.co.aaa.route</package>
<package>jp.co.bbb.route</package>
<includes>**.*</includes>
</packageScan>
org.apache.cxf.interceptor.Fault: No consumers available on endpoint: Endpoint [direct://XXXA root XXX].Exchange [ID-HW3650-3230-1517360482872-41-8] while invoking public abstract java.lang.Object jp.co.XXX.lang] [jXXX.pang]apache-camel
This is self-resolved.
I modified the packageScan in the B project camera-context.xml as follows and successfully loaded it.
<bean id="aRouteBuilder" class="jp.co.aaa.route.ARouteClass"/>
<bean id="bRouteBuilder" class="jp.co.bbb.route.BRouteClass"/>
<camelContext...>
<routeBuilder ref="aRouteBuilder"/>
<routeBuilder ref="bRouteBuilder"/>
...
</camelContext>
Thank you.
© 2024 OneMinuteCode. All rights reserved.