我想要实现的目标是从Apache Camel的ActiveMQ代理启动AMQP协议监听。
我确实从org.apache.camel.archetypes:camel-archetype-activemq (Creates a new Camel project that configures and interacts with ActiveMQ.)
原型创建了maven模块,做了mvn camel:run
并且它成功了。然后我对amqp协议进行了更改:
<!-- This creates an embedded ActiveMQ Broker -->
<broker xmlns="http://activemq.apache.org/schema/core" useJmx="true" persistent="false">
<transportConnectors>
<transportConnector name="default" uri="tcp://localhost:61616" />
<transportConnector name="amqp+nio" uri="amqp+nio://localhost:5672"/>
</transportConnectors>
</broker>
现在当我开始骆驼时,我得到以下异常:
Listening for connections at: tcp://localhost:61616
Connector default Started
ERROR Failed to start Apache ActiveMQ. Reason: java.io.IOException:
Transport Connector could not be registered in JMX:
Transport scheme NOT recognized: [amqp+nio]
答案 0 :(得分:6)
该原型设置了一组ActiveMQ依赖项,以启动最小代理。您还需要包含
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-amqp</artifactId>
<version>5.8.0</version>
</dependency>
公开AMQP传输连接器。