Skip to content
Python bindings to librabbitmq-c
C Python Makefile Shell
Latest commit 5b2e9e1 Mar 22, 2016 @ask ask Merge pull request #45 from rogerhu/pyerr_occurred
Check if the return value is -1.  If so, goto fail, which will invoke PyErr_Ocurred().
Failed to load latest commit information.
Modules/_librabbitmq Merge pull request #47 from rogerhu/fix_hostname_corruption Mar 22, 2016
contrib/release
funtests Adds funtests directory Nov 2, 2012
librabbitmq
rabbitmq-c @ 185ce08
rabbitmq-codegen @ b25efdd Use rabbitmq-codegen 3.4.1 Nov 17, 2014
requirements
.gitignore Use 'make dist' to compile from May 29, 2012
.gitmodules Update to correct submodule URL for rabbitmq-codegen. Jul 18, 2014
AUTHORS Adds rmihael to AUTHORS Oct 30, 2015
Changelog Bumps version to 1.6.1 and updates Changelog Nov 17, 2014
LICENSE-GPL-2.0 Prepare distribution for release Jun 14, 2010
LICENSE-MPL-RabbitMQ Prepare distribution for release Jun 14, 2010
MANIFEST.in Use 'make dist' to compile from May 29, 2012
Makefile Merge branch '1.6' Nov 17, 2014
README.rst Typo in README Jan 7, 2015
TODO Channel.basic_cancel, Channel.flow, Channel.recover, + (read on) May 23, 2012
benchmark.py Renamed to 'librabbitmq' May 21, 2012
setup.cfg Merge branch '1.6' Nov 17, 2014
setup.py Update setup.py to fix buildout-related problems Oct 30, 2015

README.rst

librabbitmq - Python AMQP Client using the rabbitmq-c library.

Version: 1.6.0
Download:http://pypi.python.org/pypi/librabbitmq/
Code:http://github.com/celery/librabbitmq/
Keywords:rabbitmq, amqp, messaging, librabbitmq, rabbitmq-c, python, kombu, celery

Python bindings to the RabbitMQ C-library rabbitmq-c. Supported by Kombu and Celery.

Installation

Install via pip:

$ pip install librabbitmq

or, install via easy_install:

$ easy_install librabbitmq

Downloading and installing from source

Download the latest version from
http://pypi.python.org/pypi/librabbitmq/

Then install it by doing the following,:

$ tar xvfz librabbitmq-0.0.0.tar.gz
$ cd librabbitmq-0.0.0
$ python setup.py build
# python setup.py install # as root

Using the development version

You can clone the repository by doing the following:

$ git clone git://github.com/celery/librabbitmq.git

Then install it by doing the following:

$ cd librabbitmq
$ make install        # or make develop

Examples

Using with Kombu:

>>> from kombu import Connection
>>> x = Connection("librabbitmq://")

Stand-alone:

>>> from librabbitmq import Connection

>>> conn = Connection(host="localhost", userid="guest",
...                   password="guest", virtual_host="/")

>>> channel = conn.channel()
>>> channel.exchange_declare(exchange, type, ...)
>>> channel.queue_declare(queue, ...)
>>> channel.queue_bind(queue, exchange, routing_key)

Producing

>>> channel.basic_publish(body, exchange, routing_key, ...)

Consuming

>>> def dump_message(message):
...     print("Body:'%s', Properties:'%s', DeliveryInfo:'%s'" % (
...         message.body, message.properties, message.delivery_info))
...     message.ack()

>>> channel.basic_consume(queue, ..., callback=dump_message)

>>> while True:
...    connection.drain_events()

Poll

>>> message = channel.basic_get(queue, ...)
>>> if message:
...     dump_message(message)
...     print("Body:'%s' Properties:'%s' DeliveryInfo:'%s'" % (
...         message.body, message.properties, message.delivery_info))

Other

>>> channel.queue_unbind(queue, ...)
>>> channel.close()
>>> connection.close()

License

This software is licensed under the Mozilla Public License. See the LICENSE-MPL-RabbitMQ file in the top distribution directory for the full license text.

Something went wrong with that request. Please try again.