Topic Consumer
Shows how to build a background worker that consumes topic events with explicit offset commits.
Source: link/sdks/rust/examples/topic-consumer/
What it does
- Creates a table and a topic
- Routes table inserts to the topic (
ALTER TOPIC ... ADD SOURCE) - Inserts a row (which publishes to the topic)
- Polls the consumer group for records
- Marks records processed and commits offsets synchronously
Run it
Expected output:
Requires the consumer feature (enabled in the example crate).
Topic routing
Consumer pattern
Install with the consumer feature:
Next
- Summarizer Agent — same worker pattern in TypeScript
- Realtime Subscriptions
- Chat With AI
Last updated on