rabbitmq amqp version negotiation failing with Qpid 6.0.0
I am running rabbitmq server 3.1.5 and trying to connect to this broker from a Qpid 6.0.0 client (both running on Linux). The rabbitmq broker is using amqp 0-9-1. When I try to connect from the Qpid client, it fails with "connection reset". From the Qpid client stack trace (I've masked the first two octets of the IP addresses):
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
On the RabbitMQ broker side, the log file shows:
=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}}
The rabbitmq error message indicates that it is rejecting the proposed amqp version 1-0-10 from the Qpid client.
I captured a tcpdump trace of the attempted session, and I see the client (.33 above) opens the TCP connection, sends an amqp message with protocol ID 1-1, version 0-10, and then follows that by sending another amqp message with protocol ID 0-0, version 9-1. However, the rabbitmq broker side (.41 above) seems to have given up after the 1-0-10 message and resets the TCP connection without processing the 0-9-1 amqp message.
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
Any ideas how I can get the rabbitmq broker to take the {0,0,9,1} version negotiation?
Rabbimq implements AMQP 0.9.1 and qpid client 1.0.
Try using the AMQP 1.0 RabbitMQ plug-in.
You can enble it using:
rabbitmq-plugins enable rabbitmq_amqp1_0
The following plugins have been enabled:
rabbitmq_amqp1_0
please read here
The current field of AMQP 1.0 clients is somewhat limited. Therefore we have not achieved as much interoperability as we might like.
We have tested against:
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 and 0.4).
You are using the Qpid Client for earlier versions which speaks AMQP 0-8 through 0-10. Its default behaviour is to initiate a connection a connection at 0-10 and then negotiate if it receives a different protocol response from the Broker.
When connecting this client to RabbitMQ, you should see a connection attempt at 0-10, which Rabbit will reject with a 0-91 protocol response, and then the client should automatically retry at this suggestion. From what you have posted above it appears that Rabbit is upholding its side of the bargain.
If you turn on logging on the Qpid client side (logger org.apache.qpid to DEBUG), this might help you understand why things are going wrong.
For a comparison, here's what I see when connecting the Qpid Client to RabbitMQ 3.5.4 (some superfluous lines omitted).
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
As an alternative, you can lock the Qpid Client to a particular protocol version with system property qpid.amqp.version
. Starting your code with -Dqpid.amqp.version=0-91
will mean it will skip the negotiation phase entirely.