Apache camel 2.17使用spring上下文在终点上没有消费者可用

时间:2017-11-15 15:17:47

标签: xml spring apache-camel

在连接两个不同的驼峰上下文时,在终点没有消费者可用。 JBoss保险丝6.3 EAP服务器6.4 包装:战争

Camel Context 1:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans            http://www.springframework.org/schema/beans/spring-beans.xsd                   http://camel.apache.org/schema/spring                 http://camel.apache.org/schema/spring/camel-spring.xsd">
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route id="_route1">
            <from id="_from1" uri="file:C:/Temp/Selva/inbox?noop=true"/>
            <log id="_log1" loggingLevel="INFO" message=" Proxy Route..!!! "/>
            <to id="_to1" uri="direct-vm:inProvider"/>
        </route>
    </camelContext>
</beans>

Camel Context2:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans                          http://www.springframework.org/schema/beans/spring-beans.xsd                           http://camel.apache.org/schema/spring                            http://camel.apache.org/schema/spring/camel-spring.xsd">
    <camelContext  xmlns="http://camel.apache.org/schema/spring">
        <route id="_route1">
            <from id="_from1" uri="direct-vm:inProvider"/>
            <log id="_log1" loggingLevel="INFO" message="Modelling Platform Router..!!! "/>
            <to id="_to1" uri="file:C:/Users/cpiespc/Selva/outbox"/>
        </route>
    </camelContext>
</beans>

的web.xml:

<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
      <display-name>CamelContext</display-name>
      <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:META-INF/spring/*.xml</param-value>
      </context-param>
      <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
      </listener>
    </web-app>

1 个答案:

答案 0 :(得分:0)

您不能通过JBoss EAP上的direct-vm连接,因为类加载器隔离会在部署为WAR文件时阻止它。

你可以通过wildfly-camel子模块来实现,但我不知道,但你可以问那个团队:https://github.com/wildfly-extras/wildfly-camel