[rabbitmq-discuss] RabbitMQ appears to send 0-9-1 formated message to 0-8 client

Simon MacMullen simon at rabbitmq.com
Wed Apr 4 10:57:48 BST 2012


On 04/04/12 00:16, Elias Levy wrote:
> It seems the client is dying while unpacking the redelivered field in a
> message delivery command.  The Net::AMQP client only supports the 0-8
> protocol.  I've verified that RabbitMQ believes the client is connected
> using AMQP 0-8.  My guess is that RabbitMQ is sending the client a 0-9-1
> formated message, instead of a 0-8 message.  The "redelivered" field
> does not appear to be defined in 0-8, and its type in 0-9-1 is boolean
> or "t", which is also not defined in 0-8.  Thus, Net::AMQP is throwing
> an error when it finds a field of an unknown type.

Hmm.

This is interesting, but I have a hard time believing it I'm afraid.

1) basic.deliver has a "redelivered" field in both AMQP 0-8 and 0-9-1 
(see line 2957 of the 0-8 XML).
2) In both versions of the standard, redelivered is of type "bit".
3) I don't recall any of the AMQP codec code changing since 2.5.1.
4) This is really basic stuff, any client that couldn't unpack 
basic.deliver would be so broken as to be useless.

So I wonder what might really be happening?

I note that Net::AMQP throws that exception in a function called 
unpack_field_table(). But the method fields aren't in a table.

We do however create a table in the message headers that has a key 
"redelivered". In federation. You haven't recently started using 
federation by any chance?

And we make that field boolean, because that's what it is. But from the 
AMQP 0-8 spec:

4.2.5.5  Field Tables

Field tables are long strings that contain packed name ­value pairs. 
Each name ­value pair is a structure that provides a field name, a field 
type, and a field value.  A field can hold a tiny text string, a long 
string, a long signed integer, a decimal, a date and/or time, or another 
field table.

Damn it.

So I guess we need to do some field type mapping when talking to 0-8 
clients. I had hoped the 0-8 clients would have gone away by now...

Cheers, Simon

-- 
Simon MacMullen
RabbitMQ, VMware


More information about the rabbitmq-discuss mailing list