Skip to main content

A simple RabbitMQ client

Project description

QuickMQ

An easy-to-use RabbitMQ client.

pipeline status

coverage report

Latest Release

Table of Contents

Description

QuickMQ is a purely python implementation of a RabbitMQ client. QuickMQ abstracts concepts like connection drops, authentication, and message encoding to make interacting with RabbitMQ as easy as possible.

When is QuickMQ a Good Fit

  • When you need to publish AMQP messages
  • When setup is not a priority
  • When multiple server connections are required

What QuickMQ Cannot Do

  • Work Queues
  • Transactions
  • Confirm that a consumer received a message

QuickMQ is meant to be fairly simple in order to reduce the complexity for a user so these concepts are left out. Clients like pika or aio-pika might be a better fit if you are looking for these features.

Installation

QuickMQ is currently still being tested, but it can be installed from the PyPI index.

pip install quickmq

Requirements

Python >= 3.7

Usage

QuickMQ uses 'configuration variables' to make interacting with RabbitMQ trivial. For example, publishing to your default server and exchange with default credentials can be done in two lines of code.

import quickmq as mq

mq.publish('Hello World!')

Configuration variables are not required. The previous code can be generalized to connect to any server(s) with any credentials as follows.

import quickmq as mq

mq.connect('server1', 'server2', auth=('username', 'password'))

mq.publish('Hello World!', exchange='amq.topic', key='intro.test')

This will publish 'Hello World!' to the 'amq.topic' exchange on both server1 and server2.

Changing Defaults

The following is a list of all configuration varaibles, what they do, their default value, and acceptable value.

Variable Name Acceptable Values Default Value What it does
RECONNECT_TRIES int 5 How many times quickmq will try to reconnect to a server, negative for infinite.
RECONNECT_DELAY float >= 0 5.0 Delay between reconnect attempts.
DEFAULT_SERVER str "localhost" Default server to connect to.
DEFAULT_EXCHANGE str "" Default exchange to publish to.
DEFAULT_USER str "guest" Default username to connect with.
DEFAULT_PASS str "guest" Default password to connect with.
DEFAULT_ROUTE_KEY str "" Default routing key to publish with.
RABBITMQ_PORT int 5672 Port to connect to rabbitmq server with.

To change a configuration variable use the following command:

quickmq.configure('default_server', 'new_server', durable=True)

This will permenently change the default server that QuickMQ will connect to. Set durable to false (the default) to make the change for the current runtime only. Using None as the second argument will reset the configuration variable back to its default value.

quickmq.configure('default_server', None, durable=True)

Contributing

Contributions welcome!

Currently need to implement consumer behaviour and topology editor.
Docker is required to run tests.
To run tests simply use the Makefile:

make test

Authors

Created/Maintained by Max Drexler

License

MIT License. See LICENSE for more information.

MIT License

Copyright (c) [2020] [Max Drexler]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

QuickMQ-0.6.3.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

QuickMQ-0.6.3-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file QuickMQ-0.6.3.tar.gz.

File metadata

  • Download URL: QuickMQ-0.6.3.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for QuickMQ-0.6.3.tar.gz
Algorithm Hash digest
SHA256 4180b7128f03e592bd8f40e6faef3d11fedca8909130918a04716a82b8e32ba3
MD5 52a991ce08156c135ed6718b72b03cd6
BLAKE2b-256 9813dfab04898f7cd7ae5f8c8757f6a4f4b29d5361312edcf7890525c9c34b8a

See more details on using hashes here.

File details

Details for the file QuickMQ-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: QuickMQ-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for QuickMQ-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 976fa011723deb66a3a621030882fc599f900704f533df50dd351851a3c4ba32
MD5 1acffd6657389a0d77e98f29d6c637c2
BLAKE2b-256 05933937c3692424c4211b243a8a51799139ad8ffe4c18ee7d40f001ffcf86cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page