Navigation

To send and receive messages you need a transport and a connection.
There are several transports to choose from (amqp, librabbitmq, redis, qpid, in-memory, etc.),
and you can even create your own. The default transport is amqp.

The connection will not be established yet, as the connection is established
when needed. If you want to explicitly establish the connection
you have to call the connect()
method:

>>> connection.connect()

You can also check whether the connection is connected:

>>> connection.connectedTrue

Connections must always be closed after use:

>>> connection.close()

But best practice is to release the connection instead,
this will release the resource if the connection is associated
with a connection pool, or close the connection if not,
and makes it easier to do the transition to connection pools later:

A connection without options will use the default connection settings,
which is using the localhost host, default port, user name guest,
password guest and virtual host “/”. A connection without arguments
is the same as:

>>> Connection('amqp://guest:guest@localhost:5672//')

The default port is transport specific, for AMQP this is 5672.

Other fields may also have different meaning depending on the transport
used. For example, the Redis transport uses the virtual_host argument as
the redis database number.

Default transport if not provided in the URL.
Can be a string specifying the path to the class. (e.g.
kombu.transport.pyamqp:Transport), or one of the aliases:
pyamqp, librabbitmq, redis, qpid, memory, and so on.

ssl:

Use SSL to connect to the server. Default is False.
Only supported by the amqp and qpid transports.

insist:

Insist on connecting to a server.
No longer supported, relic from AMQP 0.8

connect_timeout:

Timeout in seconds for connecting to the
server. May not be supported by the specified transport.

transport_options:

A dict of additional connection arguments to
pass to alternate kombu channel implementations. Consult the transport
documentation for available options.