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
QUIC
for client-server protocol communication.- Employs a
stream
pool to avoid frequent creation. - Implements a
pipeline
mode for sending messages, enhancing message transmission concurrency.
- Employs a
- Ensures secure message transmission with
mutual TLS
authentication. - Server supports three
features
to 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 inredb
files, and messages are stored insqlite
files, 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 messages
anddelayed messages
. ClientProducers
can 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
Producer
implements theSink trait
, andConsumer
implements 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