Skip to main content

QuillMQ: a lightweight single-node message broker (work queues, pub/sub, RPC, durable delivery).

Project description

QuillMQ

CI PyPI version Python versions Licence

A lightweight, single-node message broker written from scratch in Python asyncio. It provides work queues, pub/sub fan-out, RPC request/reply, and at-least-once durable delivery over a small custom TCP protocol. No RabbitMQ or AMQP dependency.

QuillMQ is to RabbitMQ what SQLite is to PostgreSQL: not a replacement for a clustered production broker, but the better fit when you want embeddable, single-node, zero-ops messaging you can read and own. See COMPARISON.md for an honest side-by-side.

Install

uv sync --extra dev

Run the broker

uv run quillmq serve --port 5555 --data ./quill.db

Omit --data for an in-memory broker.

Python client

from quillmq import connect

conn = await connect("quill://127.0.0.1:5555")
ch = await conn.channel()
await ch.declare_queue("tasks", durable=True)
await ch.publish("", "tasks", {"job": 1})
async for msg in ch.consume("tasks", prefetch=10):
    handle(msg.body)
    await msg.ack()

Patterns

  • Work queue: many consumers on one queue compete; each message is delivered once.
  • Pub/sub: bind several queues to a fanout or topic exchange.
  • RPC: await ch.rpc_call("service.rpc", {...}), served by quillmq.rpc.RPCServer.

CLI

quillmq serve --port 5555 --data ./quill.db
quillmq publish "" tasks '{"job": 1}'
quillmq stats
quillmq tail tasks

Running in production (single node)

QuillMQ is single-node by design (no clustering), but a single instance is built to run as a real service:

quillmq serve \
  --port 5555 \
  --data ./quill.db \
  --auth-token "$QUILLMQ_AUTH_TOKEN" \
  --tls-cert cert.pem --tls-key key.pem \
  --heartbeat 60 \
  --max-delivery-count 10 --dead-letter-queue dead \
  --metrics-port 9095 \
  --json-logs
  • Structured logging (text or JSON), and graceful shutdown on SIGTERM/SIGINT.
  • Idle connections are reaped after --heartbeat seconds; clients send keepalives automatically.
  • Poison messages are dead-lettered after --max-delivery-count attempts; set a per-message TTL with a ttl header (seconds).
  • TLS: pass --tls-cert/--tls-key and connect with a quills:// URL.
  • Prometheus metrics are served at http://host:9095/metrics.
  • Every flag has a QUILLMQ_* environment variable equivalent.

Docker

docker compose up --build

This starts a durable broker on port 5555 with a named volume for persistence. To build the image directly:

docker build -t quillmq:latest .

Behind a TLS-intercepting corporate proxy, pass your CA or, as a last resort:

docker build -t quillmq:latest \
  --build-arg UV_SYNC_FLAGS="--allow-insecure-host pypi.org --allow-insecure-host files.pythonhosted.org" .

Licence

Apache-2.0.

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

quillmq-0.1.0.tar.gz (99.4 kB view details)

Uploaded Source

Built Distribution

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

quillmq-0.1.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file quillmq-0.1.0.tar.gz.

File metadata

  • Download URL: quillmq-0.1.0.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quillmq-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8613bd864cde6bda1563a9395e3912fcb80d42efe9da660b0c1cb1316e94ccfe
MD5 b9e19dbf0b4dff77eec9f38d7f466eac
BLAKE2b-256 9391aae1ef0c2936bfe29100724d8f0524cdf23eb1d58cccb09381b6937cc28f

See more details on using hashes here.

Provenance

The following attestation bundles were made for quillmq-0.1.0.tar.gz:

Publisher: publish.yml on bha6kar/quillmq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quillmq-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quillmq-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quillmq-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c3441573c2c7bf22d734e8dd40f312a8eeba56658e65beebe6c4e74cb241bf7
MD5 4c0a1a564f572d4b6c00252579af0416
BLAKE2b-256 39a3e602c73ac4619595f4e2223feaa65b7f1601003fc5e57629a9541a237ab1

See more details on using hashes here.

Provenance

The following attestation bundles were made for quillmq-0.1.0-py3-none-any.whl:

Publisher: publish.yml on bha6kar/quillmq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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