Message Objects - kombu.message

kombu.transport.message

Message class.

class kombu.message.Message(channel, body=None, delivery_tag=None, content_type=None, content_encoding=None, delivery_info={}, properties=None, headers=None, postencode=None, accept=None, **kwargs)[source]

Base class for received messages.

exception MessageStateError

The message has already been acknowledged.

Message.accept
Message.ack()[source]

Acknowledge this message as being processed., This will remove the message from the queue.

Raises:MessageStateError – If the message has already been acknowledged/requeued/rejected.
Message.ack_log_error(logger, errors)[source]
Message.acknowledged

Set to true if the message has been acknowledged.

Message.body
Message.channel
Message.content_encoding
Message.content_type
Message.decode()[source]

Deserialize the message body, returning the original python structure sent by the publisher.

Message.delivery_info
Message.delivery_tag
Message.errors = None
Message.headers
Message.payload

The decoded message body.

Message.properties
Message.reject(requeue=False)[source]

Reject this message.

The message will be discarded by the server.

Raises:MessageStateError – If the message has already been acknowledged/requeued/rejected.
Message.reject_log_error(logger, errors, requeue=False)[source]
Message.requeue()[source]

Reject this message and put it back on the queue.

You must not use this method as a means of selecting messages to process.

Raises:MessageStateError – If the message has already been acknowledged/requeued/rejected.