Skip to main content

Payl[oad Spoo]ler

Build Status

Send your payload now, treat it later.

What is this?

Payler is an asyncio-based Python application intended to provide a way of delaying message execution. The goal of this program is to reduce the workload on your existing message broker solution (Only RabbitMQ is currently supported, but other message-brokers can be easily implemented) by putting the payloads in a storage backend which will then be polled to re-inject payloads in the corresponding destination.

Installation

Through pypi:

$ pip install payler

Through poetry:

$ git clone https://github.com/tbobm/payler
$ cd payler
$ poetry install

How to use this

Using the command line:

  1. Specify the input and output URLs for your drivers (see configuration)
  2. (optional) Customize the configuration to suit your needs currently the example configuration is the only valid one
  3. Run payler payler --config-file configuration.yaml

Using the docker image:

  1. Pull the docker image docker pull ghcr.io/tbobm/payler:latest
  2. (optional) Customize the configuration to suit your needs currently the example configuration is the only valid one (mount the configuration file into the volume at /configuration.yaml)
  3. Run the docker image and provide environment variables docker run -d --name payler -e BROKER_URL="amqp://payler:secret@my-broker/" -e MONGODB_URL="mongodb://payler:secret@my-mongo/payler" ghcr.io/tbobm/payler

Configuration

In order to configure the different workflows, payler uses a configuration file (see configuration.yml).

Example config file:

---
workflows:
  - name: "Fetch payloads from RabbitMQ and store them in MongoDB"
    location: "payler"
    callable: "client.process_queue"
  - name: "Re-injects payloads to RabbitMQ"
    callable: "client.watch_storage"

The workflows[].name attribute is currently unused, but will offer a more human-friendly way of getting informed about a workflow's state. The workflows[].location corresponds to the package where the workflows[].callable can be found. It defaults to payler, but can this is a way of offering a dumb and simple plugin mechanism by creating function matching the following signature:

async def my_workflow(loop: asyncio.AbstractEventLoop) -> None:
    """My user-defined workflow."""
    # configure your driver(s)
    input_driver.serve()

Features

  • Listen to a Broker Queue
  • Store messages with a duration or date as metadata
  • Re-inject the messages after the duration in the default Exchange
  • Output failed messages to global output

Testing

This project has unittests with pytest. A wrapper script is available at run-tests.sh.

Contributing

Feel free to open new issues for feature requests and bug reports in the issue page and even create PRs if you feel like it.

This project is linted with pylint with some minor adjustments (see the setup.cfg).

Note

This side-project is born from the following:

  • I wanted to experiment with Python's asyncio
  • A friend of mine had issues with delaying lots of messages using RabbitMQ's delayed exchange plugin
  • I was looking for a concrete use-case to work with Github Actions.

Metadata

Release files for payler 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for payler 0.2.0
File Size Uploaded Provenance Actions
payler-0.2.0.tar.gz 10.9 kB Without provenance Details for payler-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for payler 0.2.0
File Interpreter ABI Platform Actions
payler-0.2.0-py3-none-any.whl Python 3 none any Details for payler-0.2.0-py3-none-any.whl

Total release size: 23.4 kB

Release files / payler-0.2.0.tar.gz

Download URL payler-0.2.0.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0103bbe176283798ce7a895e08b2281e2b38033b6804143a37bd6915549249bd
BLAKE2b-256 checksum
How to use checksums
039f72384865be9a929f0b675685f4456b7a16c2821408176010169c6bb362b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

Release files / payler-0.2.0-py3-none-any.whl

Download URL payler-0.2.0-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
834a55a894ac0ad0c7f8b04e767590bcfdd611c2cbbe751938c9004bc147a513
BLAKE2b-256 checksum
How to use checksums
0713ff19f6a82297e2bd624003c58132490dad5b7942dee575329d931e399d5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1039-azure

Security for payler 0.2.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page