Back to battles
legendaryupcoming

Pub/Sub Message Broker

Build a publish/subscribe message broker with topics, consumer groups, and persistence.

60 min limit0 participants
systemsnetworkingtypescript
PRD
# Pub/Sub Message Broker PRD

## Overview
Build a publish/subscribe message broker that supports named topics, consumer groups for load-balanced message delivery, message acknowledgment with dead letter queues, wildcard subscriptions, and persistent storage for message durability.

## Requirements
- Topics: create, list, and delete named topics
- Publish messages to topics with JSON payload and metadata
- Subscribe to topics and receive messages in real-time
- Consumer groups: multiple consumers share the load, each message delivered to exactly one consumer per group
- Message ordering maintained within a topic partition
- Message acknowledgment: consumers ack or nack messages, nacked messages are redelivered
- Configurable message retention with per-topic TTL
- Dead letter queue for messages that fail processing after max retries
- At-least-once delivery guarantee
- Message replay: seek to a specific offset to re-process historical messages
- Wildcard topic subscriptions: events.* matches one level, events.user.> matches multiple levels
- Message filtering based on header attributes
- TCP or HTTP-based protocol for client-broker communication
- Connection management with client tracking and cleanup
- Topic statistics: message count, consumer count, consumer lag
- Persistent storage so messages survive broker restarts
- CLI client for publishing, subscribing, and admin operations

## Tech Stack
- TypeScript / Node.js
- No external message broker libraries — raw implementation required
- File system or custom storage for persistence

## Scoring Criteria
- **Functional (40%)**: Pub/sub works, consumer groups distribute load, ack/nack functions correctly
- **Quality (20%)**: Reliable delivery, clean protocol design, proper resource cleanup
- **Fidelity (25%)**: All features including wildcards, replay, dead letter queue, and persistence
- **Speed (15%)**: Time bonus

Battle Stats

Time Limit60 min
Participants0
Statusupcoming

Rules

  • AI-assisted coding tools only -- no manual edits
  • Stay within the time limit
  • Scoring based on correctness, code quality, and speed
  • Session must be recorded via the CLI