AMQP Client using the rabbitmq-c library.
Project description
- Version:
- 2.0.1-dev2
- Download:
- Code:
- Keywords:
rabbitmq, amqp, messaging, librabbitmq, rabbitmq-c, python, kombu, celery
Note: This is a (temporary) fork of librabbitmq with fixes for memory leaks included in https://github.com/celery/librabbitmq/pull/145.
Python bindings to the RabbitMQ C-library rabbitmq-c. Supported by Kombu and Celery.
Installation
Install via pip:
$ pip install librabbitmq-fork
or, install via easy_install:
$ easy_install librabbitmq-fork
Downloading and installing from source
- Download the latest version from
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for librabbitmq_fork-2.0.1.dev2-py3.8-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | fded19a8a505be416132e7c0f49612299b5d9e7dbdd154461c99611ca6999c67 |
|
MD5 | 479ce2fe3b55515cffec9edea1b350bc |
|
BLAKE2b-256 | 68b6eaf405fb6c62bcc3b3c8d878c9f6114d0f2a3c37700d372dca0bf42635c3 |
Hashes for librabbitmq_fork-2.0.1.dev2-py3.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f04748d6d85db414b23880e688cc03f57e1bb268bb0557d436e468edfc9f8c6 |
|
MD5 | ffad675828b8714efcb8a0945d7b404b |
|
BLAKE2b-256 | 4900fd8931aadbfa0fb41d774b22fc44ae567a6d0d2d57bb1261857e83a8cf76 |
Hashes for librabbitmq_fork-2.0.1.dev2-py3.6-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98bef084efc63f3422973bc3d22b99fd1083f5f78ac1a8bd4d802d5b088aeb96 |
|
MD5 | be4ac13584b2f737a109bfbd49495a5b |
|
BLAKE2b-256 | 022dc665444f0e48e7e1b07764d785754834174e9b4521da4242c70dfc49619a |
Hashes for librabbitmq_fork-2.0.1.dev2-py3.5-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4cb79a8a69eb4798041a5f16e418741bf4dfd0babbd9b9955f491ad3301b395 |
|
MD5 | e35d890b87485341a5a6c9f3bfae1815 |
|
BLAKE2b-256 | 1b12f65f143794a3c9b9f0e7ef183eb2889ec0a9e5ca14776c59577ac2afb59e |
Hashes for librabbitmq_fork-2.0.1.dev2-py2.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86766408977d8cbfcd836216c03d34b81934e8b595be555d8a4da0f2a029b4c3 |
|
MD5 | 135d3712dfa6eb5659650caf94945e4c |
|
BLAKE2b-256 | c7b4d207553b5c86ef927ebc2df5473abaaa1bcba819d3a4541462162ed136d7 |