Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Redis Pubsub Event Architect

    1

    Architect and implement reliable Redis Streams with consumer groups, persistent messaging, and failure recovery.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Redis Pubsub Event Architect

    Redis Pubsub Event Architect

    Example session with this skill installed

    Design a reliable message queue for a microservice using Redis Streams in Python. I need consumer groups and a way to handle messages that were never acknowledged.

    • Read your context and instructions
    • Compiled the redis pubsub event

    I have designed a Redis Streams architecture for your microservice. This implementation uses consumer groups for horizontal scaling and handles message recovery via the Pending Entries List (PEL).

    Redis Streams Reliable Consumer Logic

    import redis
    import time
    
    r = redis.Redis(host='localhost', port=6379, decode_responses=True)
    STREAM_NAME = 'orders_stream'
    GROUP_NAME = 'order_processor_group'
    CONSUMER_NAME = 'consumer_1'
    
    # 1. Initialize Stream and Group
    try:
        r.xgroup_create(STREAM_NAME, GROUP_NAME, id='0', mkstream=True)
    except redis.exceptions.ResponseError:
        pass # Group already exists
    
    def process_messages():
        while True:
            # 2. Check for pending (unacknowledged) messages first
            pending = r.xreadgroup(GROUP_NAME, CONSUMER_NAME, {STREAM_NAME: '0'}, count=10)
            
            # 3. Read new messages if no pending tasks
            if not pending:
                messages = r.xreadgroup(GROUP_NAME, CONSUMER_NAME, {STREAM_NAME: '>'}, count=10, block=2000)
            else:
                messages = pending
    
            for stream, msgs in messages:
                for message_id, data in msgs:
                    try:
                        print(f"Processing {message_id}: {data}")
                        # Simulate work
                        time.sleep(0.1)
                        # 4. Acknowledge successful processing
                        r.xack(STREAM_NAME, GROUP_NAME, message_id)
                    except Exception as e:
                        print(f"Failed to process {message_id}: {e}")
    
    if __name__ == "__main__":
        # Producer Example: r.xadd(STREAM_NAME, {'order_id': '123'}, maxlen=100000)
        process_messages()
    

    Next steps

    1. Implement a monitoring script using XPENDING to identify messages stuck in the PEL for longer than your TTL.
    2. Update your producer code to use the MAXLEN parameter to prevent the Redis instance from running out of memory.
    3. Configure your deployment to spin up multiple consumer instances using unique CONSUMER_NAME identifiers.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Managing high-throughput messaging in Redis often leads to data loss or unacknowledged messages when using simple pub/sub. This skill provides the architectural logic to move beyond fire-and-forget patterns into persistent, reliable Redis Streams.

    What it does

    • Architectural Selection determines whether Pub/Sub, Redis Streams, or key-space notifications fit the specific persistence requirements.
    • Producer Implementation generates code for XADD operations with bounded MAXLEN to prevent memory exhaustion.
    • Consumer Group Configuration builds XGROUP CREATE and XREADGROUP logic for distributed message processing.
    • Reliability Engineering handles message acknowledgement via XACK and manages retries using the Pending Entries List (XPENDING, XCLAIM).

    How it works

    1. Analyze Requirements to choose between ephemeral fire-and-forget or persistent stream-based messaging.
    2. Generate Producer Logic for bounded streams to ensure predictable memory usage.
    3. Establish Consumer Groups to enable horizontal scaling and message replayability.
    4. Implement Acknowledgment Flows to recover from consumer failures and process pending entries.

    Frameworks & tools

    This skill outputs production-ready logic for Node.js and Python environments. It utilizes the Redis Streams API, including consumer group management and manual acknowledgment commands.

    Why this beats prompting it yourself

    Generic prompts often ignore the complexities of the Pending Entries List (PEL) or fail to bound stream length, leading to memory leaks. This skill enforces strict reliability patterns and memory safety guardrails by default.

    Use cases

    • Microservices Orchestration where reliable event delivery between services is required.
    • Real-time Analytics requiring replayable message logs for late-joining consumers.
    • Job Queuing Systems that need distributed processing with explicit task completion signals.

    Known limitations

    Does not support global system package installation or administrative Redis commands. Strictly restricted to Node.js and Python code outputs within the active workspace.

    Requires Node.js or Python environment. No support for global system packages or administrative Redis configuration. Workspace restricted to local directory.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 2 days ago

    Requires

    File System Read/Write (strictly scoped to current project workspace `./`).
    Zero global installation or elevated privileges required.

    Permissions

    Read Files

    Target Use Cases: - Build a persistent task queue using Redis Streams. - Implement Redis consumer group with message acknowledgement. - Configure Redis Streams XREADGROUP with error claiming.

    Listed2 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the transition from fragile fire-and-forget patterns to robust Redis Streams, implementing critical reliability features like consumer groups, manual acknowledgments (XACK), and failure recovery logic for pending entries.

    The skill generates production-ready code specifically for Node.js and Python environments, utilizing the native Redis Streams API to ensure high performance and broad compatibility across modern backend stacks.

    Unlike generic AI outputs, this skill enforces memory safety by automatically implementing bounded streams (MAXLEN) and provides specific logic for managing the Pending Entries List (PEL) to prevent message loss during consumer crashes.

    You receive the complete architectural logic for producer/consumer workflows, including code for XADD operations, XGROUP management, and retry mechanisms for unacknowledged messages within your active workspace.

    This skill focuses exclusively on application-level logic for messaging and does not handle administrative Redis server commands or the installation of global system packages or database drivers.

    New in Data & Databases