3. Message Data Types
Note
Support for AMQP 1.0 encoding and decoding is work in progress.
Message body, sent to a RabbitMQ stream, is any Python object having one of the types
bytesA data section of AMQP message containing opaque binary data. It can carry any binary message encoded with third-party encoders like MessagePack.
The data type is also accepted as a member of a container type like sequence, or dictionary.
NoneAn AMQP message with null value.
strAn AMQP message with string value encoded with Unicode.
boolAn AMQP message with boolean value (true or false).
intAn AMQP message with integer value. The value is encoded with AMQP type as defined by the table
Value Range
AMQP Type Name
[-231, 231 - 1]
int
[-263, 263 - 1]
long
[263, 264 - 1]
ulong
All other, AMQP integer types are parsed as Python
inttype.floatAn AMQP message with value of AMQP type double. AMQP type float is parsed as value of Python type float, as well.
- sequence
An AMQP message with value of AMQP type list. Python
listandtupletypes are supported when serializing to AMQP format. Always decoded into a Python list.dictAn AMQP message with value of AMQP type map. The order of key-value pairs in a map is preserved on encoding and decoding. In AMQP standard, the order of key-value pairs is semantically important, but this is not the case for Python dictionary.
datetime.datetimeAn AMQP message with value of AMQP type timestamp. Unaware datetime object is encoded as UTC timestamp value. Decoded datetime object has UTC timezone.
uuid.UUIDAn AMQP message with an universally unique identifier as defined by RFC-4122, section 4.1.2.
SymbolSymbolic value from a constrained domain. The value is an ASCII string.