Skip to main content

Redis Message Queue Backend for Abstract Backend

A production-ready Redis Streams-based message queue backend implementation for the Abstract Backend project. This backend extends message queue capabilities to support Redis, enabling reliable, scalable, and high-performance Abstract Backend event processing.

Status & Quality

CI/CD & Testing

CI Documentation Documentation Build Check

Code Coverage & Quality

codecov Quality Gate Status Reliability Rating Security Rating Maintainability Rating

Code Style & Standards

Code style: black linting: pylint Imports: isort Type Checked: mypy

Package Info

PyPI version Supported Versions License: MIT

Downloads

Downloads Downloads/Month Downloads/Week


Overview

abe-redis is a Redis Streams-based message queue backend that integrates seamlessly with the Abstract Backend's component loading mechanism. It provides a reliable, scalable solution for handling Abstract Backend events using Redis as the message queue infrastructure.

Key Features

  • 🔌 Plug-and-Play: Install via pip and configure with environment variables
  • ⚡ Redis Streams: Modern stream-based message processing with consumer groups
  • 🚀 Production Ready: Connection pooling, error handling, and retry logic built-in
  • 🔄 Async-First: Built for modern Python async/await patterns
  • 📦 Universal Compatibility: Works with any project using the same component loading mechanism
  • 🧪 Well Tested: Comprehensive unit and integration tests with high coverage
  • 📚 Fully Documented: Complete API reference and usage examples

Python Version Support

Python 3.12, 3.13

Quick Start

Installation

Install the package via pip:

pip install abe-redis

Configuration

Configure your environment to use Redis as the message queue backend:

export QUEUE_BACKEND=redis
export REDIS_URL=redis://localhost:6379/0

Start Redis

Using Docker (recommended):

docker run -d --name test-redis -p 6379:6379 redis:7-alpine

Basic Usage

import asyncio
from abe_plugin.backends.message_queue import RedisMessageQueueBackend


async def main():
    # Create backend from environment variables
    backend = RedisMessageQueueBackend.from_env()

    # Publish a message
    await backend.publish("slack:events", {"type": "message", "text": "Hello Redis!"})

    # Consume messages
    async for message in backend.consume():
        print(f"Received: {message}")
        break

    await backend.close()


asyncio.run(main())

Architecture

The Redis backend uses Redis Streams for reliable message queueing:

  • Persistent Storage: Messages stored in Redis Streams with configurable retention
  • Consumer Groups: Distributed consumption across multiple workers
  • Automatic Acknowledgment: Messages acknowledged after successful processing
  • Stream Pattern Matching: Automatically discovers and consumes from slack:* streams
  • Connection Pooling: Efficient connection management with configurable pool size

Configuration Options

Environment Variable Required Default Description
QUEUE_BACKEND Yes - Must be set to redis
REDIS_URL Yes redis://localhost:6379/0 Redis connection URL
REDIS_PASSWORD No None Redis authentication password
REDIS_SSL No false Enable SSL/TLS connection
REDIS_MAX_CONNECTIONS No 10 Maximum connection pool size
REDIS_STREAM_MAXLEN No 10000 Maximum stream length for trimming

Documentation

For comprehensive documentation, including API references, examples, and development guides:

📚 Full Documentation

Quick Links

Development

Prerequisites

  • Python 3.12 or 3.13
  • Redis 6.0+ (7.0+ recommended)
  • uv or pip package manager

Setup Development Environment

# Clone the repository
git clone https://github.com/Chisanan232/abe-redis.git
cd abe-redis

# Install dependencies
uv sync

# Start Redis for testing
docker run -d --name redis-dev -p 6379:6379 redis:7-alpine

# Run tests
uv run pytest

# Run tests with coverage
uv run pytest --cov=abe_plugin --cov-report=html

Code Quality

The project follows strict code quality standards:

Run quality checks:

# Format code
uv run black abe_plugin/ test/

# Lint code
uv run pylint abe_plugin/

# Sort imports
uv run isort abe_plugin/ test/

# Type check
uv run mypy abe_plugin/

Contributing

We welcome contributions! Please see our Contributing Guide for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and quality checks
  5. Commit your changes (git commit -m 'feat: add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

Support

If you encounter any issues or have questions:


Made with ❤️ for the Abstract Backend ecosystem

Metadata

Release files for abe-redis 0.1.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 abe-redis 0.1.0
File Size Uploaded Provenance
abe_redis-0.1.0.tar.gz 9.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for abe-redis 0.1.0
File Interpreter ABI Platform
abe_redis-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.2 kB

Release files / abe_redis-0.1.0.tar.gz

Download URL abe_redis-0.1.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b8dbeb7d251c16fced08d42b6a53927e67ca7f06bbb68cb84759c6a4bad4d908
BLAKE2b-256 checksum
How to use checksums
d4f3d07c7e46ffe21756da01a3cad7fea6a02ebe92169e177e768e4bda8bd2f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / abe_redis-0.1.0-py3-none-any.whl

Download URL abe_redis-0.1.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbbbb9f8ccbd9aa146a68d8109ff191dcf67932d05655a6cdeb99ef6ef335558
BLAKE2b-256 checksum
How to use checksums
83a2eac63563a44540bef93f97b10526fbb5e17468c4743915aaa87bb7a396db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Security for abe-redis 0.1.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