How to add a header key:value pair when publishing a message with pika
You would use pika.BasicProperties to add headers.
channel.basic_publish(exchange=self.exchange,
routing_key=self.routing_key,
properties=pika.BasicProperties(
headers={'key': 'value'} # Add a key/value header
),
body=message)
The official documentation for pika does indeed not cover this scenario exactly, but the documentation does have the specifications listed. I would would strongly recommend that you bookmark this page, if you are going to continue using pika.