← Back to the chapter · Previous detail · Next detail →
Technical detail · AMQP Delivery: Guarantees and Acknowledgements
Message property reference
| Property | Description | Example |
|---|---|---|
| Content-Type | MIME type of body | application/json, text/plain |
| Content-Encoding | Encoding applied | gzip, utf-8 |
| Correlation-ID | Links related messages | UUID for request-reply matching |
| Reply-To | Return address queue | reply_queue_abc123 |
| Message-ID | Unique identifier | UUID for deduplication |
| Timestamp | Creation time | Unix timestamp |
| Type | Application-specific type | sensor.reading, order.created |
| App-ID | Producing application | temperature-sensor-01 |
This illustrative fragment sets content description, IDs, reply address, creation time, application type and producer identity. The surrounding program supplies imports and the request correlation value.
properties = pika.BasicProperties(
content_type='application/json',
content_encoding='utf-8',
message_id=str(uuid.uuid4()),
correlation_id=request_correlation_id,
reply_to='response_queue',
timestamp=int(time.time()),
type='sensor.temperature',
app_id='weather-station-01',
delivery_mode=2
)