Search code examples
rabbitmqspring-amqp

Is there a size limit on a RabbitMQ message header?


I plan on storing stacktraces in the RabbitMQ message header. Do message headers have a size limit?


Solution

  • RabbitMQ is using by default the AMQP version 0.9.1. According to the AMQP protocol specification at page 31, a field-table can contains 4 billions entries:

    long-uint = 4*OCTET

    field-table = long-uint *field-value-pair

    A long-string entry can have a length up to 4 billions octet:

    long-string = long-uint *OCTET ; length + content

    An AMQP message is split in 3 parts, header, properties, message. In the properties part you could put application-specific information. So the properties may contain your stacktrace.

    By the way, headers and properties must be keept as small as possible because there is performance penalty