[rabbitmq-discuss] AMQP protocol header mismatch

Matthias Radestock matthias at rabbitmq.com
Mon Dec 10 08:39:06 GMT 2012


On 10/12/12 03:54, Earp, Clem wrote:
> The socket
> program simply echoes back what it received. My reading of the AMQP
> standards is that the first TCP packet received after the socket
> connects is the AMQP protocol header, and if the "server" accepts the
> AMQP connection then it should echo back the same AMQP protocol header
> as a sign that it can support the protocol version.

No, that's not what the spec says. See AMQP 0-9-1 s2.2.4 (The Connection 
Class):

<quote>
- The client opens a TCP/IP connection to the server and sends a 
protocol header. This is the only data the client sends that is not 
formatted as a method.
- The server responds with its protocol version and other properties, 
including a list of the security mechanisms that it supports (the Start 
method).
</quote>

and AMQP 0-9-1 s4.2.2 (Protocol Header):

<quote>
The client and server agree on a protocol and version as follows:
- The client opens a new socket connection to the AMQP server and sends 
the protocol header.
- The server either accepts or rejects the protocol header. If it 
rejects the protocol header writes a valid protocol header to the socket 
and then closes the socket.
- Otherwise it leaves the socket open and implements the protocol 
accordingly.
[...]
- If the server does not recognise the first 5 octets of data on the 
socket, or does not support the specific protocol version that the 
client requests, it MUST write a valid protocol header to the socket, 
then flush the socket (to ensure the client application will receive the 
data) and then close the socket connection.
</quote

i.e. the server should send a Connection.Start method when it accepts 
the protocol version sent by the client, and send back a header with its 
own protocol version otherwise.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list