Architecture Overview
rabbitmq-backup is a Rust-based CLI tool that non-destructively backs up and restores RabbitMQ messages and definitions to pluggable cloud storage. This page describes the high-level architecture, component relationships, and data flow.
Design Principles
- Non-destructive -- Messages remain in queues after backup. No broker shutdown, no filesystem access, no message loss.
- Deployment-agnostic -- Connects as an external AMQP client. Works with any RabbitMQ deployment (bare metal, Docker, Kubernetes, managed services).
- Multi-cloud storage -- Pluggable storage backends via the
object_storecrate. S3, Azure Blob, GCS, and local filesystem are supported identically. - Resumable -- SQLite checkpoints enable interrupted backups to resume from the last known offset.
- Point-in-Time Recovery -- Every message is timestamped at capture time (
backed_up_at), enabling time-window filtering during restore.
Design Heritage
This project follows the architecture established by osodevops/kafka-backup, adapting the segment-based storage format and metrics patterns from Kafka to the AMQP protocol.
Component Diagram
┌─────────────────────────────────────────────────────────────────────┐
│ rabbitmq-backup CLI │
│ (clap 4.x parser) │
├──────────┬──────────┬──────────┬──────────┬─────────┬───────────────┤
│ backup │ restore │ list │ describe │validate │ definitions- │
│ │ │ │ │ │ export/import │
└─────┬────┴─────┬────┴──────────┴──────────┴─────────┴───────┬───────┘
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌────────────────┐
│ Backup │ │ Restore │ │ Definitions │
│ Engine │ │ Engine │ │ Exporter / │
│ │ │ │ │ Importer │
└─┬───┬───┬─┘ └──┬───┬───┘ └───────┬────────┘
│ │ │ │ │ │
│ │ │ │ │ │
▼ │ ▼ ▼ │ ▼
┌─────┤ ┌──────┐┌────┤ ┌───────────────┐
│Queue│ │Stream││Pub-│ │ Management │
│Read-│ │Read- ││lish│ │ Client │
│er │ │er ││er │ │ (reqwest) │
└──┬──┘ └──┬───┘└──┬─┘ └───────┬───────┘
│ │ │ │
▼ ▼ ▼ ▼
┌────────────┐ ┌───────────────────┐ ┌─────────────────┐
│ AMQP 0-9-1 │ │ Stream Protocol │ │ Management HTTP │
│ Client │ │ Client │ │ API │
│(amq-proto- │ │(rabbitmq-stream- │ │ (port 15672) │
│ col 10.x) │ │ client 0.5.x) │ └─────────────────┘
└──────┬─────┘ └────────┬──────────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ RabbitMQ Broker │
│ AMQP 0-9-1 (5672) │