gpt4 book ai didi

apache-camel - 为什么ActiveMQ 5.14.x无法启动嵌入camel-jms组件2.18.3

转载 作者:行者123 更新时间:2023-12-03 22:42:57 24 4
gpt4 key购买 nike

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

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

它有 Apache Camel 版本 2.18.3

在分行 master一切正常,因为 activemq-camel=5.14.4camel-jms=2.16.3 (从它传递)

Spring boot 应用程序以日志正常启动:

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 开始时(作为camel的主版本,在分支 not_working上)

此日志出现问题:
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.4camel-jms=2.18.3它再次正常工作......

为什么使用 ActiveMQ 5.14.x 不适用于 Camel jms 2.18.x ?

最佳答案

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

所以本质上,问题在于您正在尝试使用更新的、不兼容的 camel-jms 版本。 .当您单独添加 1.18.xcamel-jms依赖,ActiveMQ 组件网将使用此版本,该版本与其 1.16.x 不兼容版本,因此,错误。

如果您需要使用 ActiveMQ,那么您可能需要查看 camel-jms 1.16.x会为你工作。

关于apache-camel - 为什么ActiveMQ 5.14.x无法启动嵌入camel-jms组件2.18.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43552682/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com