kombu.transport.amqplib

amqplib transport.

Transport

class kombu.transport.amqplib.Transport(client, **kwargs)[source]
class Connection(*args, **kwargs)
channel(channel_id=None)
connected = True
drain_events(timeout=None)

Wait for an event on a channel.

read_timeout(timeout=None)
Transport.channel_errors = (<class 'amqp.exceptions.ChannelError'>, <class 'amqplib.client_0_8.exceptions.AMQPChannelException'>)
Transport.close_connection(connection)[source]

Close the AMQP broker connection.

Transport.connection_errors = (<class 'amqp.exceptions.ConnectionError'>, <class 'amqplib.client_0_8.exceptions.AMQPConnectionException'>, <class 'socket.error'>, <type 'exceptions.IOError'>, <type 'exceptions.OSError'>, <type 'exceptions.AttributeError'>)
Transport.create_channel(connection)[source]
Transport.default_connection_params
Transport.default_port = 5672
Transport.drain_events(connection, **kwargs)[source]
Transport.driver_name = 'amqplib'
Transport.driver_type = 'amqp'
Transport.establish_connection()[source]

Establish connection to the AMQP broker.

Transport.get_manager(*args, **kwargs)[source]
Transport.is_alive(connection)[source]
Transport.register_with_event_loop(connection, loop)[source]
Transport.supports_ev = True
Transport.verify_connection(connection)[source]

Connection

class kombu.transport.amqplib.Connection(*args, **kwargs)[source]
channel(channel_id=None)[source]
close(reply_code=0, reply_text='', method_sig=(0, 0))[source]

request a connection close

This method indicates that the sender wants to close the connection. This may be due to internal conditions (e.g. a forced shut-down) or due to an error handling a specific method, i.e. an exception. When a close is due to an exception, the sender provides the class and method id of the method which caused the exception.

RULE:

After sending this method any received method except the Close-OK method MUST be discarded.

RULE:

The peer sending this method MAY use a counter or timeout to detect failure of the other peer to respond correctly with the Close-OK method.

RULE:

When a server receives the Close method from a client it MUST delete all server-side resources associated with the client’s context. A client CANNOT reconnect to a context after sending or receiving a Close method.
PARAMETERS:

reply_code: short

The reply code. The AMQ reply codes are defined in AMQ RFC 011.

reply_text: shortstr

The localised reply text. This text can be logged as an aid to resolving issues.

class_id: short

failing method class

When the close is provoked by a method exception, this is the class of the method.

method_id: short

failing method ID

When the close is provoked by a method exception, this is the ID of the method.

connected = True
dispatch_method(method_sig, args, content)
drain_events(timeout=None)[source]

Wait for an event on a channel.

read_timeout(timeout=None)[source]
wait(allowed_methods=None)

Wait for a method that matches our allowed_methods parameter (the default value of None means match any method), and dispatch to it.

Channel

class kombu.transport.amqplib.Channel(*args, **kwargs)[source]
class Message(channel, msg, **kwargs)
Channel.basic_cancel(consumer_tag, **kwargs)[source]
Channel.basic_consume(*args, **kwargs)[source]
Channel.close()[source]
Channel.events = {'basic_return': set([])}
Channel.message_to_python(raw_message)[source]

Convert encoded message body back to a Python value.

Channel.prepare_message(body, priority=None, content_type=None, content_encoding=None, headers=None, properties=None)[source]

Encapsulate data into a AMQP message.

Message

class kombu.transport.amqplib.Message(channel, msg, **kwargs)[source]