← Back to the chapter · Previous detail · Next detail →

Technical detail · AMQP Delivery: Guarantees and Acknowledgements

Message property reference

PropertyDescriptionExample
Content-TypeMIME type of bodyapplication/json, text/plain
Content-EncodingEncoding appliedgzip, utf-8
Correlation-IDLinks related messagesUUID for request-reply matching
Reply-ToReturn address queuereply_queue_abc123
Message-IDUnique identifierUUID for deduplication
TimestampCreation timeUnix timestamp
TypeApplication-specific typesensor.reading, order.created
App-IDProducing applicationtemperature-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
)

← Back to the chapter · Previous detail · Next detail →