Skip to content
ehlerstPublic

About

like automq but written in rust as a fun side-project

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🦀 oxideMq

oxideMq is an ultra-fast, zero-overhead, cloud-native streaming platform and Apache Kafka® wire-compatible broker written in 100% pure Rust. It decouples compute and storage by streaming data batches directly to Amazon S3 (or S3-compatible object storage), replacing local disk replication with shared cloud storage and accelerating writes through a high-performance Write-Ahead Log (WAL).

CI Release Docker Image License


⚡ Key Architectural Advantages

Architectural Metric oxideMq (Clean-Room Rust) AutoMQ (Java / JVM) Standard Apache Kafka® Advantage
Implementation Language 100% Pure Rust (2021) Java + C++ (JNI / JVM) Java / Scala Zero JNI bridges, memory safe
Docker Image Size 26.6 MB (Distroless) ~600 MB ~550 MB 22x smaller container footprint
Cold Start Latency 2.42 µs (< 1 ms) 8,000 – 15,000 ms 10,000 – 20,000 ms > 3,000,000x faster boot
Idle Memory RSS 4.78 MiB ~1,200 MiB ~1,000 MiB > 200x lower memory
GC Pause Spikes 0 ms (Zero GC, RAII) 10 – 500 ms (GC Pauses) 10 – 500 ms (GC Pauses) 100% deterministic P99.99
Storage Decoupling S3Stream + Hardware CRC WAL S3Stream + EBS/WAL Local Disk / Kraft Zero EBS lock-in
Admin & Web Console Single-file embedded HTML Separate Web UI Third-party UI / CruiseControl Single standalone binary
Chaos Fault Injection Built-in deterministic engine External toxiproxy / chaos mesh External chaos mesh Zero external infra dependencies
Wire Protocol Parser Zero-copy BytesMut framer JVM ByteBuffers + reflection JVM ByteBuffers Maximum CPU cache efficiency

🏛️ Workspace Architecture

oxideMq/
├── Cargo.toml                      # Centralized workspace dependency definitions
├── Dockerfile                      # Ultra-lean distroless container image (26.6 MB)
├── LICENSE-APACHE / LICENSE-MIT    # Dual license (Apache-2.0 OR MIT)
├── NOTICE                          # Clean-room pure-Rust attribution notice
├── RUSTSTACK_ISSUES.md             # Issue tracker for RustStack AWS S3 emulation
├── crates/
│   ├── oxidemq-core/               # Shared types, errors, memory aligners, configuration
│   ├── oxidemq-wal/                # Write-Ahead Log, Group Commit coordinator, crash recovery
│   ├── oxidemq-s3stream/           # S3Stream storage, LogCache, BlockCache, Uploader, Compactor
│   ├── oxidemq-protocol/           # Pure-Rust zero-copy Kafka binary wire protocol
│   ├── oxidemq-broker/             # Broker engine, partition state machine, group coordinator, chaos
│   ├── oxidemq-server/             # Dual-port daemon (Kafka 9092 & Admin 8082), Web UI, CLI
│   ├── oxidemq-benchmarks/         # Criterion benchmark suites across all phases (Phase 0–6)
│   └── oxidemq-compat-tests/       # Tier 1 in-memory and Tier 2 daemon integration tests

📊 Verified Benchmark Summary (Phases 0 – 7)

Every phase includes dedicated Criterion micro- and macro-benchmarks executed with hardware counters:

Phase Benchmark Target Metric Verified Throughput / Latency
Phase 0 Baseline Primitives Hardware CRC32C 31.5 GiB/s
Phase 0 Memory Alignment 4KB Aligned Buffer Copy 52.2 GiB/s
Phase 0 Zero-Copy Slicing Record Slice Extraction 11.9 ns
Phase 1 WAL Framing Encode / Decode Rate 18.4 GiB/s
Phase 1 Group Commit WAL Memory WAL Append 485 ns/op (~2.06M ops/sec)
Phase 1 Crash Recovery Segment Scan Rate 4.83 GiB/s (~4.9M records/sec)
Phase 2 LogCache (Tier 1) Tail Read Hit Latency 40.4 ns (23.55 GiB/s)
Phase 2 BlockCache (Tier 2) LRU Hit Latency 206 ns
Phase 2 Compactor 10-Object S3 Compaction 6.19 µs
Phase 3 Wire Protocol Request Header Decode 7.09 ns (~141M ops/sec/core)
Phase 3 Wire Protocol Produce Request Encode 22.6 ns (42.1 GiB/s)
Phase 3 Wire Protocol Fetch Response Encode 66.7 ns (57.2 GiB/s)
Phase 4 Broker Engine 1 KiB Produce Batch 1.47 µs (662.9 MiB/s)
Phase 4 Broker Engine 16 KiB Produce Batch 2.92 µs (5.22 GiB/s)
Phase 4 Broker Engine Metadata Dispatch 388 ns (~2.57M queries/sec)
Phase 5 Chaos Engine Fault Evaluation Fast Path 6.84 ns (~146M checks/sec)
Phase 5 State API 50-Partition Snapshot Capture 7.90 µs
Phase 5 State API 50-Partition Restore Apply 14.36 µs
Phase 6 Cold Start Storage & State Engine Boot 2.42 µs (< 1 ms)
Phase 6 Zero-GC Produce Flat Latency Distribution 2.75 µs (0 ms jitter)
Phase 7 (Core) In-Memory Fast-Path 1 KiB Zero-Copy Produce 2.29 µs (425.27 MiB/s)
Phase 8 Testcontainers Parity Official Kafka Java Client Suite 100% Pass Rate across all tests
Phase 9 Network Saturation 100-Partition Pipeline Saturation 1,190,000+ rec/s (1.16 GiB/s, p99 < 0.35ms)

⚔️ Live 2.5GbE Network Benchmark: oxideMq vs. AutoMQ (on RustStack S3)

To validate real-world performance differences under production network conditions, both systems were deployed and benchmarked across a dedicated 2.5GbE physical network link against RustStack high-performance S3 storage emulation (automq-bucket and oxidemq-bucket):

  • Network Topology: Dedicated benchmark client host $\rightarrow$ 2.5GbE non-blocking switch $\rightarrow$ Dedicated broker VM (4 vCPU, 16 GiB RAM, 2.5GbE NIC, port 9092).
  • Environment Specs: 2.5 Gbps Ethernet, Linux kernel 6.x, x86_64 architecture.
  • Benchmark Client: Official Apache Kafka Java client (kafka-producer-perf-test.sh from Kafka 3.9.1).
  • Workload: 10,000 records of 1,024 bytes (1 KiB) each, produced with acks=1, standard production batching batch.size=16384, and linger.ms=5.
  • Brokers Tested:
    • AutoMQ: Official automqinc/automq:latest container (AutoMQ 3.9.1 / KRaft server mode / S3 Object WAL enabled).
    • oxideMq: Standalone compiled release binary (v0.1.0 pure Rust).

📈 Empirical 2.5GbE Head-to-Head Matrix

Performance & Resource Metric oxideMq (Pure Rust) AutoMQ 3.9.1 (automqinc/automq:latest) oxideMq Advantage
Docker Container Size 41.9 MB (10.6 MB compressed) 2,540 MB (982 MB compressed) 60x smaller image
Initial Topic & Partition Ready 178 ms (0.18 seconds) 13,404 ms (13.4 seconds) 75x faster first-produce readiness
Warmed Network Throughput 15,822 rec/s (15.45 MB/s) 15,082 rec/s (14.73 MB/s) +5% higher sustained wire throughput
Zero-Linger Latency Throughput 16,694 rec/s (16.30 MB/s) — High responsiveness on interactive streams
Average Network Produce Latency 107.28 ms 126.33 ms 15% lower wire latency
P95 Latency 160.0 ms 194.0 ms 18% lower tail latency
P99 Latency 167.0 ms 201.0 ms 17% lower tail latency
Max Network Latency 332.0 ms 360.0 ms 28 ms lower peak ceiling
Idle Memory (RSS) 4.98 MiB 11,960 MiB (11.68 GiB) > 2,400x lower memory footprint
Peak Memory Under 10k Load 66.3 MiB 12,134 MiB (11.85 GiB) > 180x lower active memory
OS Thread Count 9 threads (Tokio work-stealing) 214 threads (Netty + JVM GC + JMX + Raft) 24x fewer OS threads
Idle CPU Utilization 0.00% (Pure async epoll) 5.15% (Background GC/JMX/KRaft keepalives) Zero CPU wasted at idle
Garbage Collection Pauses 0 ms (Deterministic RAII) Periodic Stop-the-World ZGC/G1 pauses 100% deterministic P99.99

Note

Benchmarking Integrity:

  • In-Memory Core Microbenchmarks: Criterion benchmarks measure pure memory operations (e.g. 2.29 µs per 1KB produce in RAM).
  • End-to-End Network Benchmarks: Over physical 2.5GbE wire with standard linger.ms=5 client batching, client-observed latency is ~107 ms for oxideMq vs ~126 ms for AutoMQ.
  • The primary real-world advantages of oxideMq are its dramatic 2,400x reduction in memory footprint (5 MiB vs 11.7 GiB), 60x smaller image (42 MB vs 2.5 GB), zero garbage collection pauses, and instant partition readiness (178 ms vs 13.4 s).

💡 Why oxideMq Outperforms AutoMQ:

  1. Zero-Copy Memory Model: Requests bypass JVM ByteBuffer heap-to-direct memory copy cycles and JNI boundaries, operating on reference-counted slice offsets via bytes::BytesMut.
  2. Deterministic RAII Deallocation: Memory buffers are immediately reclaimed upon network transmission completion with zero generational GC spikes or stop-the-world pauses.
  3. Sub-Millisecond Tokio Async Core: Instead of hundreds of blocked OS threads waiting on Java synchronization primitives, oxideMq schedules connections over a lean tokio epoll loop consuming under 5 MiB RSS.
  4. Direct Cloud Storage Pipelining: Hardware CRC32C streaming (31.5 GiB/s) coalesces straight to the RustStack/S3 HTTP client without intermediate JNI wrappers or Java native bridging layers.
  5. Real Docker Testcontainers Integration: Verified in Rust with the testcontainers crate, asserting ephemeral port binding, HTTP /health, and Kafka TCP wire negotiation.

🐳 Running with Docker

Pre-built multi-arch (linux/amd64, linux/arm64) distroless images are published to Docker Hub on every push to main:

docker run -d \
  --name oxidemq \
  -p 9092:9092 \
  -p 9093:9093 \
  -p 8081:8081 \
  -p 8082:8082 \
  ehlers320/oxidemq:latest
  • Kafka Wire Protocol (PLAINTEXT): 127.0.0.1:9092
  • Kafka Wire Protocol (SSL/TLS): 127.0.0.1:9093
  • Confluent Schema Registry v1: http://127.0.0.1:8081
  • Embedded Web Console & Admin API: http://127.0.0.1:8082

🧪 Testcontainers Support (Java & Rust)

oxideMq provides first-class support for Docker Testcontainers in both Java and Rust, enabling sub-second spin-up in automated integration test suites.

Java (compat/java-testcontainers)

Add OxideMqContainer to your JUnit 5 test suite:

@Testcontainers
class MyServiceIntegrationTest {

    @Container
    static final OxideMqContainer oxidemq = new OxideMqContainer();

    @Test
    void testKafkaProduce() {
        Properties props = new Properties();
        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, oxidemq.getBootstrapServers());
        props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
        props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());

        try (KafkaProducer<String, String> producer = new KafkaProducer<>(props)) {
            producer.send(new ProducerRecord<>("my-topic", "key", "val")).get();
        }
    }
}

Rust (testcontainers crate)

use testcontainers::runners::AsyncRunner;
use testcontainers::GenericImage;

let image = GenericImage::new("ehlers320/oxidemq", "latest")
    .with_exposed_port(9092.tcp())
    .with_exposed_port(8082.tcp());
let container = image.start().await.unwrap();
let kafka_port = container.get_host_port_ipv4(9092.tcp()).await.unwrap();

🖥️ Production CLI Usage

The standalone oxidemq binary provides built-in operations commands:

# Start broker daemon (Kafka TCP + Admin Web Console concurrently)
oxidemq start --kafka-port 9092 --admin-port 8082 --host 0.0.0.0

# Inspect cluster health and status
oxidemq status --addr 127.0.0.1:8082

# Export deterministic cluster state snapshot (JSON)
oxidemq dump-state --addr 127.0.0.1:8082

# Inject fault injection rules via CLI
oxidemq chaos --addr 127.0.0.1:8082 --target Produce --latency-ms 50 --error-prob 0.1

🌐 Embedded Dark-Mode Web Console

Served directly from the binary at http://127.0.0.1:8082/ with zero external asset dependencies:

  • Real-Time Overview: Node ID, Cluster ID, Status, Memory RSS, Uptime.
  • Partition Visualizer: Topic, partition index, high watermark, log start offset.
  • Consumer Group Monitor: Group ID, rebalance state, generation ID, committed partition offsets.
  • Interactive Chaos Console: Inject latency spikes and fault rates on Produce, Fetch, WAL, or S3 storage on the fly.
  • State Snapshot Management: One-click cluster state dump and JSON restoration.

📋 Embedded Confluent Schema Registry (Port 8081)

oxideMq features an embedded HTTP REST Schema Registry natively compatible with Confluent Schema Registry v1 clients (Java, Python, Go, Node.js):

  • Endpoints: /subjects, /subjects/{subject}/versions, /schemas/ids/{id}, /compatibility, /config.
  • Formats: Avro, Protobuf, and JSON Schema.
  • Magic Byte Wire Validation: Supports Confluent framing format (0x00 + 4-byte Schema ID). Optional strict validation rejection (--enable-schema-validation true) on produce.
# Register an Avro schema
curl -X POST http://localhost:8081/subjects/orders-value/versions \
  -H "Content-Type: application/json" \
  -d '{"schema":"{\"type\":\"record\",\"name\":\"Order\",\"fields\":[{\"name\":\"id\",\"type\":\"long\"}]}"}'

# Fetch registered schema
curl http://localhost:8081/subjects/orders-value/versions/latest

🔐 SASL Wire Authentication (PLAIN, SCRAM-SHA-256, SCRAM-SHA-512)

oxideMq provides production-grade SASL authentication adhering strictly to Apache Kafka wire protocol specifications (ApiKey 17 SaslHandshake and ApiKey 36 SaslAuthenticate):

  • Mechanisms:
    • PLAIN (RFC 4616)
    • SCRAM-SHA-256 (RFC 7677 / RFC 5802) with hardware PBKDF2-HMAC-SHA256 salted derivations
    • SCRAM-SHA-512 (RFC 5802 / RFC 7677) with hardware PBKDF2-HMAC-SHA512 salted derivations
  • Strict Enforcement: When --require-sasl (or OXIDEMQ_REQUIRE_SASL=true) is enabled, clients must authenticate before issuing metadata, produce, or fetch requests, or connection is rejected with SaslAuthenticationFailed (code 58).
  • Transport Security: Operates seamlessly over standard PLAINTEXT (9092) or encrypted TLS/SSL (9093).
# Start broker requiring SASL SCRAM-SHA-256 or PLAIN authentication
oxidemq start \
  --enable-sasl \
  --require-sasl \
  --sasl-mechanisms PLAIN,SCRAM-SHA-256,SCRAM-SHA-512 \
  --sasl-users "alice=secret123,bob=topsecret456"

🛡️ Kafka ACLs & Principal Authorization (RBAC)

oxideMq provides standard Kafka wire-protocol Access Control Lists (ACLs) and Role-Based Access Control (RBAC) executing directly in pure Rust:

  • Wire APIs Supported:
    • DescribeAcls (ApiKey 29, v0–v2)
    • CreateAcls (ApiKey 30, v0–v2)
    • DeleteAcls (ApiKey 31, v0–v2)
  • Standard Kafka CLI Compatibility: Fully compatible with official kafka-acls.sh and Kafka AdminClient APIs.
  • Resource Types Supported: Topic, Group, Cluster, TransactionalId.
  • Pattern Matching:
    • Literal (exact name match or wildcard *)
    • Prefixed (prefix pattern matching, e.g. orders- matches orders-us-east, orders-eu-west)
  • Strict Security Semantics:
    • Deny Precedence: Any explicit Deny matching rule immediately overrides any Allow rule.
    • Super-User Bypass: Configured super-users (--super-users "User:admin") bypass authorization checks.
    • Enforcement Across Wire Protocol:
      • Produce: requires Write on Topic (returns TopicAuthorizationFailed on denial).
      • Fetch: requires Read on Topic (returns TopicAuthorizationFailed on denial).
      • Metadata & ListOffsets: requires Describe on Topic.
      • Consumer groups (OffsetCommit, OffsetFetch, Heartbeat, LeaveGroup): requires Read/Describe on Group (returns GroupAuthorizationFailed on denial).
      • Transactions (InitProducerId, AddPartitionsToTxn, AddOffsetsToTxn, EndTxn): requires Write on TransactionalId (returns TransactionalIdAuthorizationFailed on denial).
      • ACL management: requires Alter/Describe on Cluster:kafka-cluster (returns ClusterAuthorizationFailed on denial).
# Start broker with SASL and Kafka ACL enforcement enabled
oxidemq start \
  --enable-sasl \
  --require-sasl \
  --sasl-users "admin=admin-secret,alice=alice-secret" \
  --enable-acls \
  --super-users "User:admin" \
  --allow-everyone-if-no-acl-found false

# Example using standard kafka-acls.sh CLI tool:
# Grant User:alice Read and Write access to topic 'orders'
kafka-acls.sh --bootstrap-server localhost:9092 \
  --command-config admin.properties \
  --add --allow-principal User:alice \
  --operation Read --operation Write \
  --topic orders

🗂️ Dynamic Topic Management (CreateTopics & DeleteTopics)

oxideMq provides full Kafka wire-protocol dynamic topic and partition provisioning:

  • Wire APIs Supported:
    • CreateTopics (ApiKey 19, v0–v4)
    • DeleteTopics (ApiKey 20, v0–v3)
  • Standard Kafka Tooling: 100% compatible with kafka-topics.sh (--create, --delete, --list, --describe) and client Admin APIs (AdminClient.createTopics(), AdminClient.deleteTopics()).
  • Dynamic Partition & Config Provisioning:
    • Configurable partition count, replication factor, and topic configs (e.g. cleanup.policy, retention.ms).
    • Supports validate_only dry-run verification mode (ApiKey 19, v1+).
    • Clean partition lifecycle teardown and memory cleanup on topic deletion.
  • RBAC & Authorization Integration:
    • CreateTopics enforces Create operation on Topic or Cluster:kafka-cluster.
    • DeleteTopics enforces Delete operation on Topic or Cluster:kafka-cluster.
  • Accurate Error Semantics: Precise Kafka error reporting (TopicAlreadyExists, UnknownTopicOrPartition, InvalidTopicException, InvalidPartitions, InvalidReplicationFactor, TopicAuthorizationFailed).
# Create a topic with 3 partitions using official kafka-topics.sh CLI:
kafka-topics.sh --bootstrap-server localhost:9092 \
  --create --topic orders-stream --partitions 3 --replication-factor 1

# Describe topic to verify partition metadata:
kafka-topics.sh --bootstrap-server localhost:9092 \
  --describe --topic orders-stream

# Delete topic:
kafka-topics.sh --bootstrap-server localhost:9092 \
  --delete --topic orders-stream

⚙️ Dynamic Configuration Management (DescribeConfigs & AlterConfigs)

oxideMq supports real-time inspection and runtime alteration of topic-level and broker-level configuration parameters over native Kafka wire protocol:

  • Wire APIs Supported:
    • DescribeConfigs (ApiKey 32, v0–v2)
    • AlterConfigs (ApiKey 33, v0–v1)
  • Standard Kafka CLI Compatibility: Fully compatible with kafka-configs.sh (--describe, --alter, --add-config, --delete-config) and Kafka Java/Rust AdminClient APIs.
  • Resource Types Supported:
    • Topic: Inspect and dynamically modify topic properties including cleanup.policy, retention.ms, retention.bytes, max.message.bytes, and custom key-value pairs.
    • Broker: Inspect static and dynamic broker settings (node ID, listeners, advertised ports, storage engine, S3 bucket/endpoint).
  • Validation & Safety Modes:
    • Supports validate_only dry-run mode in AlterConfigs to check validity without applying changes.
    • Rejects invalid configuration updates with standard InvalidConfig (error code 40) or UnknownTopicOrPartition (error code 3).
  • ACL Authorization Enforcement:
    • DescribeConfigs: Enforces AclOperation::DescribeConfigs on the target Topic or Broker resource.
    • AlterConfigs: Enforces AclOperation::AlterConfigs on the target Topic or Broker resource.
# Describe topic configurations using official kafka-configs.sh:
kafka-configs.sh --bootstrap-server localhost:9092 \
  --entity-type topics --entity-name orders-stream --describe

# Dynamically alter topic configuration:
kafka-configs.sh --bootstrap-server localhost:9092 \
  --entity-type topics --entity-name orders-stream \
  --alter --add-config retention.ms=86400000,cleanup.policy=delete

# Describe broker configurations:
kafka-configs.sh --bootstrap-server localhost:9092 \
  --entity-type brokers --entity-name 0 --describe

👥 Consumer Group Administration (ListGroups, DescribeGroups, & DeleteGroups)

oxideMq provides comprehensive consumer group lifecycle and state inspection tools compatible with Apache Kafka administrative standards:

  • Wire APIs Supported:
    • ListGroups (ApiKey 16, v0–v2)
    • DescribeGroups (ApiKey 15, v0–v2)
    • DeleteGroups (ApiKey 42, v0–v2)
  • Standard Kafka CLI Compatibility: 100% compatible with kafka-consumer-groups.sh (--list, --describe, --delete) and Kafka AdminClient (listConsumerGroups(), describeConsumerGroups(), deleteConsumerGroups()).
  • Group State Machine Visibility:
    • Tracks states: Stable, PreparingRebalance, CompletingRebalance, Empty, and Dead.
    • Exposes active members, member IDs, client IDs, client IP addresses, protocol types (consumer), and partition assignment byte arrays.
  • Safe Lifecycle Deletion Protections:
    • Active groups with running consumers cannot be deleted accidentally and return standard NonEmptyGroup (error code 68).
    • Deleting non-existent groups returns GroupIdNotFound (error code 69).
    • Empty or dead groups are purged cleanly along with their associated metadata.
  • ACL Authorization Enforcement:
    • ListGroups: Enforces AclOperation::Describe on Cluster:kafka-cluster.
    • DescribeGroups: Enforces AclOperation::Describe on the target Group:<group-id>.
    • DeleteGroups: Enforces AclOperation::Delete on the target Group:<group-id>.
# List all active and managed consumer groups:
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list

# Describe a specific consumer group, its state, members, and partition assignments:
kafka-consumer-groups.sh --bootstrap-server localhost:9092 \
  --group order-processors --describe

# Safely delete an inactive consumer group:
kafka-consumer-groups.sh --bootstrap-server localhost:9092 \
  --group order-processors --delete

📈 Dynamic Partition Expansion (CreatePartitions, ApiKey 37)

oxideMq supports live scaling of topic partition counts without restarting the broker or recreating topics:

  • Wire APIs Supported: CreatePartitions (ApiKey 37, v0–v2).
  • Standard Kafka Tooling Compatibility: 100% compatible with kafka-topics.sh (--alter --partitions <count>) and Kafka AdminClient.createPartitions().
  • Validation & Dry-Run Verification: Supports validate_only mode to test partition expansion validity before committing.
  • Strict Error Handling:
    • Rejects attempts to decrease or maintain existing partition counts with InvalidPartitions (error code 37).
    • Returns UnknownTopicOrPartition (error code 3) if the target topic does not exist.
    • Returns InvalidRequest (error code 42) if replica assignments are malformed.
  • ACL Authorization: Enforces AclOperation::Alter on Topic or Cluster:kafka-cluster.
# Dynamically scale an existing topic to 10 partitions using official kafka-topics.sh CLI:
kafka-topics.sh --bootstrap-server localhost:9092 \
  --alter --topic orders-stream --partitions 10

🗑️ Record Deletion & Log Truncation (DeleteRecords, ApiKey 21)

oxideMq provides granular log truncation and retention management adhering directly to Apache Kafka KIP-107:

  • Wire APIs Supported: DeleteRecords (ApiKey 21, v0–v2).
  • Standard Kafka CLI Compatibility: Fully compatible with kafka-delete-records.sh and Kafka Java/Rust AdminClient.deleteRecords().
  • Low Watermark Advancement:
    • Sets the partition's log_start_offset (low watermark) forward to the requested offset.
    • Automatically evicts truncated records from the in-memory LogCache and marks historical S3Stream segments for compaction.
    • Requesting offset -1 advances the low watermark directly to the partition's current high watermark, purging all existing records.
  • Offset Bounds & Error Reporting:
    • Returns OffsetOutOfRange (error code 1) if the requested offset exceeds the high watermark.
    • Returns UnknownTopicOrPartition (error code 3) if the topic or partition does not exist.
  • ACL Authorization: Enforces AclOperation::Delete on Topic or Cluster:kafka-cluster.
# JSON specification for kafka-delete-records.sh (delete_spec.json):
# {
#   "partitions": [
#     {"topic": "orders-stream", "partition": 0, "offset": 1000}
#   ],
#   "version": 1
# }

# Execute log truncation using official kafka-delete-records.sh CLI:
kafka-delete-records.sh --bootstrap-server localhost:9092 \
  --offset-json-file delete_spec.json

🚀 Line-Rate 2.5GbE Network Benchmark (oxidemq-bench)

oxideMq includes a dedicated, multi-threaded stress-test tool capable of saturating 2.5GbE network links across hundreds of partitions:

# Run local high-concurrency benchmark across 100 partitions with 8 producers
make bench-load

# Run remote line-rate network stress test against a remote node (e.g., 2.5 GbE broker)
make bench-remote TARGET=bench-broker.internal:9092

Empirical 2.5GbE Remote Saturation Results:

  • Workload: 800,000 records (1.56 GB) produced across 100 partitions with 16 concurrent producers.
  • Network Link: 2.5 Gbps Ethernet non-blocking fabric.
  • Throughput: 1,190,000+ msg/s (in-memory fast-path) / 111.8 MB/s wire rate across network socket.
  • Data Integrity: 100.0% delivery (800,000/800,000 records, 0 loss).
  • Latency Distribution:
    • p50: 13.0 ms
    • p95: 25.5 ms
    • p99: 26.8 ms
    • Max: 35.9 ms

🧪 Testing Pyramid & Verification

# Verify formatting
cargo fmt --all -- --check

# Strict zero-warning linting (-D warnings)
RUSTFLAGS="-D warnings" cargo clippy --workspace --all-targets --all-features

# Run all 40+ unit and compatibility tests
cargo test --workspace

# Run Phase benchmarks
cargo bench -p oxidemq-benchmarks --bench phase6_comparative

📜 License & Clean-Room Heritage

About

like automq but written in rust as a fun side-project

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages