A message queue library inspired by Pulsar, including both server and client components.
- Custom communication protocol for handling packet assembly/disassembly, minimizing message size.
- Server protocol utilizes the serde library for serialization/deserialization. Currently supports bincode and json, with the ability for users to specify custom formats.
- Uses
QUICfor client-server protocol communication.- Employs a
streampool to avoid frequent creation. - Implements a
pipelinemode for sending messages, enhancing message transmission concurrency.
- Employs a
- Ensures secure message transmission with
mutual TLSauthentication. - Server supports three
featuresto adapt to different deployment scenarios:- Local Memory Mode (
local-memory): Metadata and messages are stored in the memory of the current node, suitable for one-time testing. - Local Persistence Mode (
local-persist): Metadata is stored inredbfiles, and messages are stored insqlitefiles, suitable for single-node persistence in non-distributed scenarios. - Distributed Mode (
distributed): Metadata is stored inetcd, and messages are stored inPostgreSQL, suitable for large-scale distributed deployments.
- Local Memory Mode (
- The server is stateless, allowing nodes to be started and stopped freely. Clients will automatically migrate to other nodes if the server connection is lost.
- Supports both
immediate messagesanddelayed messages. ClientProducerscan specify the delivery time for the server to send the message to consumers. - Supports specifying the retention policy for acknowledged messages based on
quantity/TTL. - Topic supports
partitioning, allowing client producers to round-robin messages across multiple topic partitions on different nodes, enhancing message sending concurrency. - Client
Producerimplements theSink trait, andConsumerimplements theStream trait, facilitating usage in streaming scenarios.
-
Install mkcert
-
Generate cert authentication files
make init- Start the client
cargo run --example client- Start the server
# local-memory mode
cargo run --example server --features local-memory
# local-persist mode
cargo run --example server --features local-persist
# distributed mode
cargo run --example server --features distributed