AMQP Client using the rabbitmq-c library.
Project description
- Version:
- 2.0.2-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.2.dev2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b2d10b7195fdab4fa257f67b68c7fb79de4f5a7f4ecb8cdc53ef2fdceb4614f |
|
MD5 | 4936beeaedcbe8ff25e5dec115cb3b96 |
|
BLAKE2b-256 | fdb1c6b723a6007df5aa092e563d1624c7d20ab656c9e93aa37fa84e201b89d3 |
Hashes for librabbitmq_fork-2.0.2.dev2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a838292b150dcdff89d1f30e6aab627829c9ec21fc7f765cad7463a062bed5f |
|
MD5 | 1c2ed2558ecad1678c0f5460ddbfafee |
|
BLAKE2b-256 | 215af20a254f9405af119089a7b8fbd8104b1ab1f068f9a00bb36a3c6047df7a |
Hashes for librabbitmq_fork-2.0.2.dev2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0726b68740a82a14d4b408c6dbb6c816ce6e0fcdd17c58b4f8f63db251fcbed |
|
MD5 | 531b6db31aaf5d43058e71f56017644b |
|
BLAKE2b-256 | ad049652aa9b626b47de64152a6736ca4e5f6f7cb235c53643a8c0e0d01e5d4b |
Hashes for librabbitmq_fork-2.0.2.dev2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3b6fa722baa1933f9ba320e765feed9816c780669f7ca29dddf63788eedcf0 |
|
MD5 | a1e2a2bd2b3f0f1d8c9b9eff5e05bdbe |
|
BLAKE2b-256 | e4751e4872a6e0ca4415257393dd51414a7fbab3f027a1300946a1b0eb528260 |
Hashes for librabbitmq_fork-2.0.2.dev2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d79c15d0f1dd0e04fd083bdc4524ee57d7966cde432b19e3bbb3e4fd6e817cc4 |
|
MD5 | 72895b765ede206f63d20679c72b1bc4 |
|
BLAKE2b-256 | da7e304f6a8ee440572c4b988e041c4a054ac01fe11a1b876dda1f4dd3c0ecae |
Hashes for librabbitmq_fork-2.0.2.dev2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6a05cdf6a9358efb97c2c86a1df68fa5d4893ca035eb8128c246ddd1c028966 |
|
MD5 | 3a0132bace72fdbf62e3cc6e8f91b89b |
|
BLAKE2b-256 | 79a5f2cede998697d88074c788559fd038ff9f0b6ce67a07c423e6008ff452ef |
Hashes for librabbitmq_fork-2.0.2.dev2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d037e3e8755c8daf3983ce8657b430807d03b1f1b7f9fcdfaf47b5a5d0feee0a |
|
MD5 | b52a51557323b9ca192e0329d62d8a1d |
|
BLAKE2b-256 | 483427200991bcff08a0130e39dc5c37e0924cd82faaa51ba78fd86971e50a2d |