1.1 KiB
1.1 KiB
SQ-011: Subscribe Endpoint (Single Node)
Status: [x] DONE
Blocked by: SQ-010
Priority: High
Description
Implement the Subscribe gRPC RPC with server-streaming. Server pushes messages to the client as they become available.
Files to Create/Modify
crates/sq-server/src/grpc/data_plane.rs- DataPlaneService Subscribe impl
Behavior
- Client sends SubscribeRequest with topic, partition, optional start_offset
- Server reads from StorageEngine starting at the given offset
- Server streams batches of ConsumedMessage to the client
- When caught up, server polls for new messages at a configurable interval (e.g. 100ms)
- Stream continues until client disconnects or cancellation
Acceptance Criteria
- Publish 10 messages, then subscribe from offset 0, receive all 10
- Subscribe from offset 5, receive messages 5-9 only
- Subscribe to empty topic from offset 0, then publish, receive new messages
- Client disconnect: server-side stream cleans up without error
- Subscribe to nonexistent topic: returns NotFound gRPC status