首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么ActiveMQ 5.14.x不能开始嵌入camel-jms组件2.18.3

为什么ActiveMQ 5.14.x不能开始嵌入camel-jms组件2.18.3
EN

Stack Overflow用户
提问于 2017-04-21 22:04:39
回答 1查看 877关注 0票数 14

下面是一个简单的spring引导项目(版本1.5.2)来演示这个问题:

https://github.com/lanwen/camel-jms-activemq-test

它有Apache 版本2.18.3

在分支master上,由于activemq-camel=5.14.4camel-jms=2.16.3 (从它那里得到过渡),所有的工作都很好。

Spring引导应用程序通常以日志启动:

代码语言:javascript
复制
2017-04-22 00:53:19.647  INFO 97217 --- [           main] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.18.3 (CamelContext: camel-1) is starting
2017-04-22 00:53:19.662  INFO 97173 --- [           main] o.apache.activemq.broker.BrokerService   : Apache ActiveMQ 5.14.4 (localhost, ID:lanwen-osx3.local-62145-1492811599544-0:1) is starting
2017-04-22 00:53:19.665  INFO 97173 --- [           main] o.apache.activemq.broker.BrokerService   : Apache ActiveMQ 5.14.4 (localhost, ID:lanwen-osx3.local-62145-1492811599544-0:1) started
2017-04-22 00:53:19.665  INFO 97173 --- [           main] o.apache.activemq.broker.BrokerService   : For help or more information please see: http://activemq.apache.org
2017-04-22 00:53:19.682  INFO 97173 --- [           main] o.a.activemq.broker.TransportConnector   : Connector vm://localhost started
2017-04-22 00:53:19.702  INFO 97173 --- [           main] o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming from: activemq://queue:to-write?asyncConsumer=true
2017-04-22 00:53:19.703  INFO 97173 --- [           main] o.a.camel.spring.SpringCamelContext      : Total 1 routes, of which 1 are started.
2017-04-22 00:53:19.704  INFO 97173 --- [           main] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.18.3 (CamelContext: camel-1) started in 0.466 seconds
2017-04-22 00:53:19.709  INFO 97173 --- [           main] ru.yandex.test.writer.MyTestApplication  : Started MyTestApplication in 2.437 seconds (JVM running for 2.911)

但是当您从camel-jms=2.18.3开始(作为骆驼的主要版本,在分支工作中上)

这个日志出了问题:

代码语言:javascript
复制
2017-04-22 00:56:38.070  INFO 97195 --- [           main] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.18.3 (CamelContext: camel-1) is starting
...
2017-04-22 00:56:43.590  WARN 97195 --- [ActiveMQ Task-1] o.a.a.t.failover.FailoverTransport       : Failed to connect to [tcp://localhost:61616] after: 10 attempt(s) continuing to retry.

但是如果我们用activemq-camel5.13.4换成camel-jms=2.18.3,它又能正常工作了.

为什么ActiveMQ 5.14.x不适用于camel-jms 2.18.x

EN

回答 1

Stack Overflow用户

发布于 2017-05-09 20:03:01

如果您查看最新的Camel ActiveMQ 1.15.5 (https://mvnrepository.com/artifact/org.apache.activemq/activemq-camel/5.14.5)的依赖列表,您会发现它已经将camel-jms作为依赖项,但版本是1.16.3。因此,不需要在POM中单独添加camel-jms 1.18.x依赖项,因为它将覆盖ActiveMQ已经使用的1.16.x版本,这是兼容的版本。

因此,从本质上讲,问题在于您试图使用一个更新的、不兼容的camel-jms版本。当您单独添加1.18.x camel-jms依赖项时,ActiveMQ组件将使用此版本,该版本与其1.16.x版本不兼容,因此出现错误。

如果您需要使用ActiveMQ,那么您可能需要查看camel-jms 1.16.x是否适合您。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43552682

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档