concept header property in category rabbitmq

appears as: headers property, The headers property
RabbitMQ in Depth

This is an excerpt from Manning's book RabbitMQ in Depth.

3.11. Custom properties using the headers property

The headers property is a key/value table that allows for arbitrary, user-defined keys and values (figure 3.14). Keys can be ASCII or Unicode strings that have a maximum length of 255 characters. Values can be any valid AMQP value type.

Figure 3.14. The headers property allows for arbitrary key/value pairs in the message properties.

Unlike the other properties, the headers property allows you to add whatever data you’d like to the headers table. It also has another unique feature: RabbitMQ can route messages based upon the values populated in the headers table instead of relying on the routing key. Routing messages via the headers property is covered in chapter 6.