smartnessai/queen-mq

By smartnessai

•Updated 2 months ago

Queen Message Queue

Image
Message queues
0

7.1K

smartnessai/queen-mq repository overview

⁠Queen MQ - PostgreSQL-backed Message Queue

A modern, performant message queue system built on PostgreSQL

License Node C++

šŸ“š Complete Documentation⁠ • šŸš€ Quick Start⁠ • āš–ļø Comparison⁠


Queen MQ is a modern PostgreSQL-backed Message Queue, high-performance, feature-rich system with unlimited FIFO partitions, consumer groups, transactions, tracing and streaming capabilities with exact-once delivery guarantees.

⁠Why Queen?

Born at Smartness⁠ to power Smartchat, Queen solves a unique problem: unlimited FIFO partitions where slow processing in one partition doesn't block others.

Perfect for:

  • Processing messages in order, without losing them somewhere in the middle
  • Do not want that a slow message processing in one partition blocks other partitions
  • When you need thousands of thousands of partitions to process messages in parallel, respecting the order of the messages
  • Process the same messages in multiple pipelines
  • Have a clear view of the message processing flow and traceability
  • Build event-driven microservices with exactly-once delivery guarantees
  • Critical systems that need to be highly available and reliable with zero message loss

⁠Quick Start

Run PostgreSQL and Queen server in Docker:

# Start PostgreSQL and Queen
docker network create queen

docker run --name postgres --network queen \
  -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres

docker run -p 6632:6632 --network queen \
  -e PG_HOST=postgres -e PG_PASSWORD=postgres \
  smartnessai/queen-mq

Install client:

npm install queen-mq

Use the client:

import { Queen } from 'queen-mq'

const queen = new Queen('http://localhost:6632')

// Create queue
await queen.queue('orders')
  .config({ leaseTime: 30, retryLimit: 3 })
  .create()

// Push with guaranteed order per partition
await queen.queue('orders')
  .partition('customer-123')
  .push([{ data: { orderId: 'ORD-001', amount: 99.99 } }])

// Consume with consumer groups
await queen.queue('orders')
  .group('order-processor')
  .concurrency(10)
  .batch(20)
  .consume(async (message) => {
    await processOrder(message.data)
  })

Complete Tutorial →⁠


⁠Key Features

  • šŸŽÆ Unlimited FIFO Partitions - No limits on ordered message streams
  • šŸ‘„ Consumer Groups - Kafka-style with replay from any timestamp
  • šŸ”„ Transactions - Atomic push+ack for exactly-once delivery
  • šŸ“” Streaming - Real-time message streams via WebSocket
  • šŸ›”ļø Zero Message Loss - Automatic failover to disk buffer
  • šŸ’€ Dead Letter Queue - Automatic handling of failed messages
  • šŸ” Message Tracing - Debug distributed workflows
  • šŸ“Š Modern Dashboard - Vue 3 web interface with analytics
  • šŸ” Encryption - Per-queue message encryption
  • ⚔ High Performance - 200K+ msg/s with proper batching

Compare with Kafka, RabbitMQ, NATS →⁠


⁠Performance

MetricValue
Throughput100K+ msg/s sustained
Latency10-50ms (POP/ACK), 50-200ms (TRANSACTION)
PartitionsUnlimited

Detailed Benchmarks →⁠


⁠Webapp

A modern Vue 3 dashboard for monitoring and managing Queen MQ:

Dashboard

Webapp Documentation →⁠


⁠Documentation

šŸ“š Complete Documentation⁠

⁠Getting Started
⁠Client Libraries
⁠Server
⁠Features

⁠Production Ready

Queen is currently running in production at Smartness⁠, handling 200k messages daily.


⁠Community & Support


⁠License

Queen MQ is released under the Apache 2.0 License⁠.


Built with ā¤ļø by Smartness⁠

Why "Queen"? Because years ago, when I first read "queue", I read it as "queen" in my mind.

Tag summary

Content type

Image

Digest

sha256:7397bcebb…

Size

55.5 MB

Last updated

2 months ago

docker pull smartnessai/queen-mq