Skip to content

Storage

AMQP queue messages are stored using the exact same underlying engine as Kafka and MQTT — File Segment — with no separate storage implementation built for AMQP. This is a direct expression of the "one data copy, multiple protocol views" architecture.

A Unified Storage Driver

All three protocol brokers — AMQP, Kafka, MQTT — write through the same StorageDriverManager, which bottoms out in the storage-engine crate's File Segment engine. A queue is, at the storage layer, a shard: messages are appended sequentially to a log and located by offset.

This means:

  • AMQP's durability guarantees, on-disk layout, and compaction/cleanup strategy are identical to Kafka/MQTT's — the same operational and monitoring know-how applies.
  • There are no AMQP-specific storage configuration knobs — storage tuning (segment size, flush policy, etc.) is configured once at the broker level, independent of protocol.

Publish Means Persisted

In confirm mode, there's no race between persistence and acknowledgement: Basic.Publish first buffers the message in memory (PendingPublish); the actual write fully awaits StorageDriverManager::write returning success before the broker builds and sends Basic.Ack/Basic.Nack. In other words, as soon as a client receives Basic.Ack, the message is genuinely on disk — there's no "ack now, write asynchronously later" path.

Capabilities Not Yet Implemented

The following storage-related features common to message-queue systems are not implemented in RobustMQ AMQP today:

FeatureStatusNotes
Message TTL / expirationNo mechanism to set an expiration time on a queue or message
Max queue lengthNo queue capacity cap, and no overflow-drop/reject policy
Dead-letter exchange (DLX)Rejected or discarded messages are simply deleted, never forwarded to a dead-letter exchange
Priority queuesNo priority-based scheduling
Lazy queuesNo memory-vs-disk two-tier storage distinction; every message goes through File Segment uniformly

Further Reading

🎉 既然都登录了 GitHub,不如顺手给我们点个 Star 吧!⭐ 你的支持是我们最大的动力 🚀