kombu.transport.base

Base transport interface.

Message

class kombu.transport.base.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.

payload

The decoded message body.

channel
delivery_tag
content_type
content_encoding
delivery_info
headers
properties
body
acknowledged

Set to true if the message has been acknowledged.

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.
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.
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.
decode()[source]

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

Transport

class kombu.transport.base.Transport(client, **kwargs)[source]

Base class for transports.

client = None

The Connection owning this instance.

default_port = None

Default port used when no port has been specified.

recoverable_connection_errors

Optional list of connection related exceptions that can be recovered from, but where the connection must be closed and re-established first.

If not defined then all connection_errors and channel_errors will be regarded as recoverable, but needing to close the connection first.

recoverable_channel_errors

Optional list of channel related exceptions that can be automatically recovered from without re-establishing the connection.

connection_errors = (<class 'amqp.exceptions.ConnectionError'>,)

Tuple of errors that can happen due to connection failure.

channel_errors = (<class 'amqp.exceptions.ChannelError'>,)

Tuple of errors that can happen due to channel/method failure.

establish_connection()[source]
close_connection(connection)[source]
create_channel(connection)[source]
close_channel(connection)[source]
drain_events(connection, **kwargs)[source]