使用Qpid 6.0.0进行rabbitmq amqp版本协商失败

时间:2016-02-06 01:01:49

标签: tcp rabbitmq amqp qpid

我正在运行rabbitmq server 3.1.5并尝试从Qpid 6.0.0客户端(都在Linux上运行)连接到此代理。 rabbitmq经纪人正在使用amqp 0-9-1。当我尝试从Qpid客户端连接时,它会失败,并且#34;连接重置"。从Qpid客户端堆栈跟踪(我已经屏蔽了IP地址的前两个八位字节):

Caused by: org.apache.qpid.AMQException: Cannot connect to broker (tcp://xx.yy.224.41:5672): Connection reset [error code 200: reply success]
        at org.apache.qpid.client.AMQConnectionDelegate_0_10.makeBrokerConnection(AMQConnectionDelegate_0_10.java:248)
        at org.apache.qpid.client.AMQConnection.makeBrokerConnection(AMQConnection.java:732)
        at org.apache.qpid.client.AMQConnection.makeConnection(AMQConnection.java:504)
        ... 5 more
Caused by: org.apache.qpid.transport.ConnectionException: Connection reset
        at org.apache.qpid.transport.ConnectionException.rethrow(ConnectionException.java:67)
        at org.apache.qpid.transport.Connection.connect(Connection.java:277)
        at org.apache.qpid.client.AMQConnectionDelegate_0_10.makeBrokerConnection(AMQConnectionDelegate_0_10.java:227)
        ... 7 more

在RabbitMQ代理端,日志文件显示:

=INFO REPORT==== 5-Feb-2016::11:54:13 ===
accepting AMQP connection <0.7834.0> (xx.yy.224.33:37655 -> xx.yy.224.41:5672)

=ERROR REPORT==== 5-Feb-2016::11:54:13 ===
closing AMQP connection <0.7834.0> (xx.yy.224.33:37655 -> xx.yy.224.41:5672):
{bad_version,{1,1,0,10}}

rabbitmq错误消息表明它拒绝了Qpid客户端提议的amqp版本1-0-10。

我捕获了尝试会话的tcpdump跟踪,我看到客户端(上面的.33)打开TCP连接,发送协议ID为1-1的版本0-10的amqp消息,然后通过发送另一个amqp消息,协议ID为0-0,版本9-1。然而,rabbitmq经纪人方面(上面的.41)似乎已经在1-0-10消息之后放弃并重置TCP连接而不处理0-9-1 amqp消息。

4      SYN-SENT       xx.yy.224.33:35770 > xx.yy.224.41:amqp
4      SYN-RECEIVED   xx.yy.224.33:35770 > xx.yy.224.41:amqp
4      ESTABLISHED    xx.yy.224.33:35770 > xx.yy.224.41:amqp
AMQP...  this one is {1,1,0,10}
AMQP..  . this one is {0,0,9,1}
4      RESET          xx.yy.224.33:35770 > xx.yy.224.41:amqp

我是如何让rabbitmq经纪人进行{0,0,9,1}版本协商的?

2 个答案:

答案 0 :(得分:0)

Rabbimq实现了AMQP 0.9.1和qpid客户端1.0。

尝试使用AMQP 1.0 RabbitMQ插件。

您可以使用以下方式进行加密:

rabbitmq-plugins enable rabbitmq_amqp1_0
The following plugins have been enabled:
  rabbitmq_amqp1_0 

read here

  

AMQP 1.0客户端的当前字段有些限制。因此   我们没有达到我们想要的那么多的互操作性。

     

我们测试过:

SwiftMQ Java client [1] We have done most of our testing against this client and things seem to work.

QPid / Proton C client [2] We have successfully tested against the "proton" command line tool this client ships with.

QPid / Proton Java client [2] We have not been able to get this client to get as far as opening a network connection (tested against
     

0.2和0.4)。

答案 1 :(得分:0)

您使用的是Qpid Client for earlier versions,它说的是AMQP 0-8到0-10。它的默认行为是在0-10启动连接连接,然后协商它是否从Broker接收到不同的协议响应。

当将此客户端连接到RabbitMQ时,您应该看到0-10的连接尝试,Rabbit将拒绝0-91协议响应,然后客户端应该自动重试此建议。从你上面发布的内容可以看出,Rabbit正在坚持讨价还价。

如果打开Qpid客户端(logger org.apache.qpid到DEBUG)的登录,这可能有助于您理解出现问题的原因。

为了进行比较,这里是我将Qpid客户端连接到RabbitMQ 3.5.4时所看到的(省略了一些多余的行)。

08:22:39.091 [main] DEBUG org.apache.qpid.transport.Connection - SEND: [conn:a069435] AMQP.1 0-10
08:22:39.096 [IoRcvr-/127.0.0.1:60542-localhost/127.0.0.1:5672] DEBUG org.apache.qpid.transport.Connection - RECV: [conn:a069435] AMQP.0 9-1
08:22:39.097 [IoRcvr-/127.0.0.1:60542-localhost/127.0.0.1:5672] DEBUG org.apache.qpid.transport.Connection - connection closed: conn:a069435
08:22:39.100 [main] DEBUG o.a.q.c.protocol.AMQProtocolSession - Setting ProtocolVersion to :0-91
08:22:39.109 [main] DEBUG o.a.qpid.client.AMQProtocolHandler - SEND: AMQP0091

作为替代方法,您可以将Qpid客户端锁定到具有系统属性qpid.amqp.version的特定协议版本。使用-Dqpid.amqp.version=0-91启动代码将意味着它将完全跳过协商阶段。