Multiple camel context not accepted in Spring Boot Came single configl xml model ?

…衆ロ難τιáo~ 提交于 2020-01-06 05:57:05

问题


Base Facts : Apache Camel 2.20.1 (Spring Boot)

Multiple context reference in same spring boot config xml throws below highlighted error, despite providing explicit different ids

When my own example failed - I tried with simple sample case.. but met with the same error

Error creating bean with name 'typeConverter' defined in class path resource >[org/apache/camel/spring/boot/TypeConversionConfiguration.class]: Unsatisfied >dependency expressed through method 'typeConverter' parameter 0; nested >exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: >No qualifying bean of type 'org.apache.camel.CamelContext' available: expected >single matching bean but found 2: camel1,camel2

<!-- here we have the 1st CamelContext -->
<camelContext id="camel1" xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:one" />
        <to uri="mock:result" />
    </route>
</camelContext>

<!-- and there we have the 2nd CamelContext -->
<camelContext id="camel2" xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="direct:two" />
        <to uri="log:two" />
        <to uri="mock:result" />
    </route>
</camelContext>

My context are being called from Spring boot starter class as follows.

@SpringBootApplication
@ComponentScan(basePackages="com.wm")
@ImportResource("classpath:META-INF/spring/spring-context.xml")
public class ExtAuthServiceAppStarter {
    public static void main(String[] args) {
    SpringApplication.run(ExtAuthServiceAppStarter.class, args);
   }
}

Any suggestions ?


回答1:


Yes Spring Boot is not an application server to host N+ applications in the same JVM.

Camel on Spring Boot is optimized and adhered to run one CamelContext only.



来源:https://stackoverflow.com/questions/48101459/multiple-camel-context-not-accepted-in-spring-boot-came-single-configl-xml-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!