Skip to content

feat: message enqueue rpc (story 1.6)#6

Merged
vieiralucas merged 2 commits intomainfrom
feat/1-6-message-enqueue
Feb 11, 2026
Merged

feat: message enqueue rpc (story 1.6)#6
vieiralucas merged 2 commits intomainfrom
feat/1-6-message-enqueue

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Feb 11, 2026

Summary

  • Implement Enqueue gRPC RPC in new HotPathService (FilaService trait)
  • Add handle_enqueue in scheduler: validates queue exists, constructs composite message key, persists to RocksDB messages CF
  • Stub Lease, Ack, Nack RPCs as UNIMPLEMENTED for future stories
  • Register FilaServiceServer alongside FilaAdminServer in gRPC server builder

Test plan

  • Enqueue to non-existent queue returns QueueNotFound error
  • Enqueue persists message and verifies round-trip via get_message
  • Bulk enqueue 100 messages: all unique UUIDv7 IDs, time-ordered, all persisted
  • Existing scheduler/broker tests updated to create queue before enqueue (queue validation now enforced)
  • 35 tests pass, clippy clean, cargo fmt clean

Summary by cubic

Implements Story 1.6 by adding the Enqueue gRPC RPC so producers can write messages to named queues with durable RocksDB storage. Validates queue existence, rejects empty queue names, assigns UUIDv7 IDs, persists via composite keys, and returns the ID.

  • New Features

    • Added HotPathService (FilaService) with Enqueue; Lease/Ack/Nack remain UNIMPLEMENTED.
    • Scheduler handle_enqueue verifies queue, builds message_key, persists to the messages CF, and replies with the message ID.
    • Messages use UUIDv7 IDs, default fairness key "default", nanosecond timestamps; headers and payload preserved.
    • Registered FilaServiceServer alongside FilaAdminServer.
    • Error mapping: empty queue -> invalid_argument; QueueNotFound -> not_found; Storage -> internal.
  • Refactors

    • Replaced #[allow(dead_code)] with #[cfg(test)] for test-only helpers and storage key prefix/lease functions.

Written for commit b188778. Summary will update on new commits.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch from ae14022 to 91da999 Compare February 11, 2026 12:09
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch from 767fc0f to bb6dc55 Compare February 11, 2026 12:10
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch from 91da999 to 96eea1e Compare February 11, 2026 13:18
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch from bb6dc55 to 4970e1d Compare February 11, 2026 13:18
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch from 96eea1e to a20e922 Compare February 11, 2026 16:10
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch 2 times, most recently from 8ad8619 to 71e67d3 Compare February 11, 2026 16:11
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch 2 times, most recently from a8aefe0 to 957bfed Compare February 11, 2026 16:18
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch from 71e67d3 to 460bef4 Compare February 11, 2026 16:18
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch from 957bfed to d5a678a Compare February 11, 2026 16:21
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch from 460bef4 to ab6e29a Compare February 11, 2026 16:21
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch from d5a678a to b40c6e8 Compare February 11, 2026 16:23
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch 3 times, most recently from 67ebcd2 to e662cbf Compare February 11, 2026 21:03
@vieiralucas vieiralucas force-pushed the feat/1-5-grpc-server-queue-management branch 2 times, most recently from fc6f597 to 67eec3c Compare February 11, 2026 21:04
Base automatically changed from feat/1-5-grpc-server-queue-management to main February 11, 2026 21:11
add enqueue handler in scheduler that validates queue existence, constructs
composite message keys, and persists to rocksdb. implement FilaService grpc
trait with HotPathService serving the enqueue rpc. stub lease/ack/nack rpcs.
add tests for queue validation, persistence verification, and 100-message
bulk enqueue with unique time-ordered uuidv7 ids.
@vieiralucas vieiralucas force-pushed the feat/1-6-message-enqueue branch from e662cbf to 89e7d8e Compare February 11, 2026 21:15
@vieiralucas vieiralucas merged commit 7dff987 into main Feb 11, 2026
5 checks passed
@vieiralucas vieiralucas deleted the feat/1-6-message-enqueue branch February 11, 2026 21:37
vieiralucas added a commit that referenced this pull request Mar 18, 2026
- apply_to_broker_storage now returns Result and propagates StorageError
  instead of silently swallowing storage failures (cubic #1)
- add DeleteLeaseExpiry mutation in ack/nack replication paths to clean up
  orphaned lease expiry entries (cubic #3)
- fix no-op leased_msg_keys.retain in recovery — now properly clears
  entries for the recovering queue before rebuild (cubic #4)
- warn when create_group is called without broker_storage set (cubic #5)
- check send_command result in watch_leader_changes — only update leading
  state on success so next poll retries on failure (cubic #6, #7)
- trigger RecoverQueue on first-sight leader state to catch messages
  replicated between startup and first poll (cubic #8)
- replace catch-all _ => {} with explicit variant listing in
  apply_to_broker_storage for compiler-enforced exhaustiveness
vieiralucas added a commit that referenced this pull request Mar 18, 2026
- apply_to_broker_storage now returns Result and propagates StorageError
  instead of silently swallowing storage failures (cubic #1)
- add DeleteLeaseExpiry mutation in ack/nack replication paths to clean up
  orphaned lease expiry entries (cubic #3)
- fix no-op leased_msg_keys.retain in recovery — now properly clears
  entries for the recovering queue before rebuild (cubic #4)
- warn when create_group is called without broker_storage set (cubic #5)
- check send_command result in watch_leader_changes — only update leading
  state on success so next poll retries on failure (cubic #6, #7)
- trigger RecoverQueue on first-sight leader state to catch messages
  replicated between startup and first poll (cubic #8)
- replace catch-all _ => {} with explicit variant listing in
  apply_to_broker_storage for compiler-enforced exhaustiveness
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant