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)
Since you're using RabbitMQ I'm guessing that you're using the standard protocol, which is AMQP.
In that case you shouldn't add something like stacktraces in the header, since according to the [AMQP specification 3.2.1](http://docs.oasis-open.org/amqp/core/v1.0/amqp-core-messaging-v1.0.html#type-header) the header is used for `standard delivery details`:

> 
> The header section carries standard delivery details about the transfer of a message through the AMQP network. If the header section is omitted the receiver MUST assume the appropriate default values (or the meaning implied by no value being set) for the fields within the header unless other target or node specific defaults have otherwise been set.
> 
> 
> 

From what I found the specs doesn't mention anything about a specific size however, so it might be possible to cram a stacktrace in there if you want to :)