kombu.transport.pyamqplib — Kombu v1.3.2 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »

# kombu.transport.pyamqplib

amqplib transport.

copyright: | 2009 - 2011 by Ask Solem.
license: | BSD, see LICENSE for more details.

- Transport
- Connection
- Channel
- Message

## Transport

class `kombu.transport.pyamqplib.` `Transport`(client, **kwargs)
  class `Connection`(*args, **kwargs)
    `channel`(channel_id=None)
    `drain_events`(allowed_methods=None, timeout=None)

      Wait for an event on any channel.

    `read_timeout`(timeout=None)
    `wait_multi`(channels, allowed_methods=None, timeout=None)

      Wait for an event on a channel.

  `Transport.` `close_connection`(connection)

    Close the AMQP broker connection.

  `Transport.` `create_channel`(connection)
  `Transport.` `default_connection_params`
  `Transport.` `drain_events`(connection, **kwargs)
  `Transport.` `establish_connection`()

    Establish connection to the AMQP broker.

  `Transport.` `verify_connection`(connection)

## Connection

class `kombu.transport.pyamqplib.` `Connection`(*args, **kwargs)
  `channel`(channel_id=None)
  `close`(reply_code=0, reply_text='', method_sig=(0, 0))

    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.

  `drain_events`(allowed_methods=None, timeout=None)

    Wait for an event on any channel.

  `read_timeout`(timeout=None)
  `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.

  `wait_multi`(channels, allowed_methods=None, timeout=None)

    Wait for an event on a channel.

## Channel

class `kombu.transport.pyamqplib.` `Channel`(*args, **kwargs)
  class `Message`(channel, msg, **kwargs)

    A message received by the broker.

    `body`

      The message body.

    `delivery_tag`

      The message delivery tag, uniquely identifying this message.

    `channel`

      The channel instance the message was received on.

  `Channel.` `basic_cancel`(consumer_tag, **kwargs)
  `Channel.` `basic_consume`(*args, **kwargs)
  `Channel.` `close`()
  `Channel.` `message_to_python`(raw_message)

    Convert encoded message body back to a Python value.

  `Channel.` `prepare_message`(message_data, priority=None, content_type=None, content_encoding=None, headers=None, properties=None)

    Encapsulate data into a AMQP message.

## Message

class `kombu.transport.pyamqplib.` `Message`(channel, msg, **kwargs)

  A message received by the broker.

  `body`

    The message body.

  `delivery_tag`

    The message delivery tag, uniquely identifying this message.

  `channel`

    The channel instance the message was received on.

### Navigation

- index
- modules |
- next |
- previous |
- Kombu v1.3.2 documentation »
- API Reference »