【发布时间】:2014-07-18 20:41:38
【问题描述】:
我有以下场景:
我几天前从 Apache ServiceMix 迁移了! 4.5.3 到 5.0.0 版本,我遇到了一个小问题,至少我认为。
我的主要 Spring 配置文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:ctx="http://www.springframework.org/schema/context"
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
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
<!-- Import the First CamelContext -->
<import resource="classpath:META-INF/spring/camel-context/first-context.xml" />
<!-- Import the Second CamelContext -->
<import resource="classpath:META-INF/spring/camel-context/second-context.xml" />
<!-- Import the Third CamelContext -->
<import resource="classpath:META-INF/spring/camel-context/third-context.xml" />
</beans>
使用旧版本的 ServiceMix 时! (4.5.3),我在 Karaf 控制台中输入 camel:route-list 和 camel:context-list,我看到所有 3 个上下文(First、Seconds、Third CamelContext)都有自己的路线。没关系。
迁移到 ServiceMix 之后! 5.0.0(使用确切的代码),当我发出这些命令时,我只看到最后一个上下文Third CamelContext。不行。尽管捆绑包运行正常,但路线在那里,运行正常。我可以在 Web 控制台(如 hawtio)中看到它们。
问题
ServiceMix 是否存在问题! 5.0.0 还是我必须以某种方式修改我的代码?我想在 Karaf 控制台中查看我的所有上下文/路由,真的有助于调试...
【问题讨论】:
-
尝试翻转导入的顺序,看看你是否看到另一个骆驼。
-
@ClausIbsen 我总是只看到 Karaf 中的最后一个 CamelContext...不管我有多少 CamelContexts。
-
您在 JMX 中可以看到什么,例如,如果您使用 JConsole 连接到 karaf?您的 是否使用任何自定义 id 属性来为上下文设置名称?如果是这样,请确保它们是唯一的名称。
-
使用控制台连接到 Karaf 时,我看到了所有上下文/路由,没关系。我为每个上下文都有一个自定义 ID 属性,它不一样。我已经删除了自定义 ID 属性并且发生了同样的事情......如果我在旧版本的 ServiceMix 中安装相同的包! (4.5.3),Karaf 表现良好。
标签: apache-camel osgi apache-karaf apache-servicemix