How tejakusireddy/falconq-distributed-message-queue works
FalconQ is a Go message-queue broker. Producers publish topic messages over REST; the broker selects a partition, records the message through its Raft-backed partition state, and returns an acknowledgement. Consumers peek by offset or consume in batches with per-consumer offset tracking. The README also documents topic/partition administration and Raft statistics. The excerpts show routing, partition selection, BadgerDB persistence, and REST setup, but not the full handler implementations or Raft transport wiring; those relationships are omitted where unverified.
Main entry points: main.go Broker process
Components 18
REST API
- Broker process
broker/main.go - Publish endpoint
broker/main.go - Peek endpoint
broker/main.go - Consume endpoint
broker/main.go - Admin endpoints
broker/main.go
Topics and Partitions
- Topic registry
broker/main.go - Partition selection
broker/main.go - Consistent hashing
broker/main.go - Round-robin fallback
broker/main.go
Message Consumption
- Priority ordering
broker/main.go - Batch reads
broker/main.go - Consumer offsets
broker/main.go
Persistence and Consensus
- BadgerDB
broker/main.go - Partition FSM
broker/main.go - Raft replication
broker/main.go - Raft statistics
broker/main.go
Other components
- Producer
- Consumer
Connections 22
- Producer → Publish endpoint: publishes
README.md - Consumer → Consume endpoint: consumes
README.md - Consumer → Peek endpoint: peeks
README.md - Broker process → Publish endpoint: registers
broker/main.go - Broker process → Peek endpoint: registers
broker/main.go - Broker process → Consume endpoint: registers
broker/main.go - Broker process → Admin endpoints: registers
broker/main.go - Publish endpoint → Topic registry: gets topic
broker/main.go - Topic registry → Partition selection: selects partition
broker/main.go - Partition selection → Consistent hashing: hashes key
broker/main.go - Partition selection → Round-robin fallback: falls back
broker/main.go - Consume endpoint → Batch reads: reads batch
README.md - Consume endpoint → Consumer offsets: tracks offset
README.md - Peek endpoint → Batch reads: reads batch
README.md - Batch reads → Priority ordering: prioritizes
README.md - Batch reads → BadgerDB: reads messages
broker/main.go - Consumer offsets → BadgerDB: reads offset
broker/main.go - Partition FSM → BadgerDB: writes messages
broker/main.go - Raft replication → Partition FSM: applies commands
broker/main.go - Broker process → Raft replication: starts consensus
broker/main.go - Admin endpoints → Raft statistics: serves stats
broker/main.go - Admin endpoints → Topic registry: lists topics
broker/main.go