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

Answer: 
RabbitMQ is using by default the AMQP version 0.9.1. According to the [AMQP protocol specification](https://www.rabbitmq.com/resources/specs/amqp0-9-1.pdf) 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](https://groups.google.com/forum/#!topic/rabbitmq-users/JJ436bSC3s0)
There is a limit of 4k bytes for headers when using amqplib client for nodejs. When this is exceeded you will get the exception "Frame size exceeds frame max" and cosumer dies.

<https://github.com/squaremo/amqp.node/issues/462>