RabbitmqWorker - Python worker for Rabbitmq
RabbitmqWorker is a worker for rabbitmq which automatically reconnect to the broker if any disconnection occurs.
Why?
The main library used to manage asynchronous tasks in python is Celery. Celery has its own internal message pattern that must be respected for celery to be able to interpret the messages correctly. In our architecture, we use microservices with multiple language where their task client does not follow Celery's message principle.
The scope of this library is to make an simple library to manage every kind of message from rabbitmq.
Installation
RabbitmqWorker is avaiable from PyPI. You can install it with pip.
$ pip install rabbitmq_worker
Usage
Instanciate a RabbitmqWorker with the appropriate configuration to your needs and run it. E.g:
def process_message(channel, basic_deliver, properties, body):
print(body)
channel.basic_ack(basic_deliver.delivery_tag)
rabbitmq_worker = RabbitmqWorker(
amqp_url="amqp://guest:guest@localhost:5672/%2F",
queue_name="my_queue",
callback=process_message
)
rabbitmq_worker.run()
RabbitmqWorker use pika under the hood so your amqp_url must be compliant with URLParameters(https://pika.readthedocs.io/en/stable/modules/parameters.html#urlparameters) object.
Metadata
Release files for rabbitmq_worker 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rabbitmq_worker-0.0.7.tar.gz | 11.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rabbitmq_worker-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.5 kB
Release files / rabbitmq_worker-0.0.7.tar.gz
| Download URL | rabbitmq_worker-0.0.7.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bedbca32c0140f0134b48b42533ab28486ef05e0cd80fb623d1dfacfce4f9f7c
|
|
BLAKE2b-256 checksum How to use checksums |
700032b724b3fcbeda664f72ec4dca8fe6520c4c9dc6a28284b8bd4bc3e9157b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / rabbitmq_worker-0.0.7-py3-none-any.whl
| Download URL | rabbitmq_worker-0.0.7-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ae43df3043de850e2d213a7bdf8e85e4d1692d021f11e8e5e8861827051cc58
|
|
BLAKE2b-256 checksum How to use checksums |
784f927d56f6409bf4b2ef5b3a2a47c353095b08205c56c15df00c791ce7b39c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Security for rabbitmq_worker 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.