I am using RabbitMQ with Django through Celery. I am using the most basic setup:
# RabbitMQ connection settings
BROKER_HOST = \'localhost\'
BROKER_PORT = \'5672\
To find out the messages delivery_mode
you can consume it and look at the message properties:
>>> from tasks import add
>>> add.delay(2, 2)
>>> from celery import current_app
>>> conn = current_app.broker_connection()
>>> consumer = current_app.amqp.get_task_consumer(conn)
>>> messages = []
>>> def callback(body, message):
... messages.append(message)
>>> consumer.register_callback(callback)
>>> consumer.consume()
>>> conn.drain_events(timeout=1)
>>> messages[0].properties
>>> messages[0].properties
{'application_headers': {}, 'delivery_mode': 2, 'content_encoding': u'binary', 'content_type': u'application/x-python-serialize'}