Apache的骆驼AMQP - ActiveMQ的AMQP头失配值1,预计0 [英] Apache Camel AMQP - ActiveMQ AMQP header mismatch value 1, expecting 0
问题描述
我试图做一个Apache骆驼应用程序能够对AMQP和ActiveMQ集成。
I am attempting to make an Apache Camel application that integrates with ActiveMQ over AMQP.
我已经从工作提供'的骆驼例如弹簧的JMS 的'项目,这是在标准的TCP连接,但我已经修改为使用我的独立的ActiveMQ 5.8安装(而不是嵌入式),我已经使用TCP正常工作。
I have been working from the provided 'camel-example-spring-jms' project, which is over the standard TCP connection, but I have modified to use my standalone ActiveMQ 5.8 installation (rather than embedded), which I have working fine using TCP.
活动MQ配置( AMQP上5672 )
<transportConnectors>
<transportConnector name="openwire" uri="tcp://0.0.0.0:61610?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
</transportConnectors>
在骆驼server.xml中的'我已经取代现有的JMS'ActiveMQComponent'与'JmsComponent引用了AMQConnectionFactory在其指定我的连接URL(包括试下面的变化)。
Within 'camel-server.xml' I have replaced the existing "jms" 'ActiveMQComponent' with a 'JmsComponent' that references an 'AMQConnectionFactory' upon which I specify my connection URL (tried both variations below).
amqp://guest:guest@localhost/test?brokerlist='tcp://localhost:5672'
amqp://guest:guest@/?brokerlist='tcp://localhost:5672'
<bean id="jmsConnectionFactory" class="org.apache.qpid.client.AMQConnectionFactory">
<constructor-arg index="0"
value="amqp://guest:guest@localhost/test?brokerlist='tcp://localhost:5672'" />
</bean>
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="jmsConnectionFactory" />
<property name="useMessageIDAsCorrelationID" value="true" />
</bean>
服务器似乎开始罚款的配置上面,但是当我在一个路由添加到AMQP队列'的 ServerRoutes.java 的'我得到启动时产生错误。
The server appears to start fine with the configuration above, but when I add a route to the amqp queue in the 'ServerRoutes.java' I get an error on startup.
from("amqp:queue:numbers").to("multiplier");
在骆驼服务器窗口中的错误是:
The error in the Camel Server window is:
[nsumer[numbers]] INFO AMQConnection - to broker at tcp://localhost:5672
org.apache.qpid.AMQException: Cannot connect to broker: connect() aborted [error code 200: reply success]
在我的ActiveMQ窗口的错误是:
And the error in my ActiveMQ windows is:
org.apache.activemq.transport.amqp.AmqpProtocolException: Could not decode AMQP frame: hex: 414d51500101000a
Caused by: org.apache.qpid.proton.engine.TransportException: AMQP header mismatch value 1, expecting 0
任何帮助,是诊断这个问题picated AP $ P $。
Any help is appreicated in diagnosing this issue.
感谢。
推荐答案
我能够得到这个通过添加下列MVN依赖的工作:
I was able to get this to work by adding the following mvn dependencies:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-amqp</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jms_1.1_spec</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-amqp-1-0-client-jms</artifactId>
<version>0.24</version>
</dependency>
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-amqp-1-0-client</artifactId>
<version>0.24</version>
</dependency>
和使用此连接工厂:
<bean id="jmsConnectionFactory" class="org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl" factory-method="createFromURL">
<constructor-arg index="0" type="java.lang.String" value="amqp:///?brokerlist='tcp://localhost:5672''" />
这篇关于Apache的骆驼AMQP - ActiveMQ的AMQP头失配值1,预计0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!