No description
  • Go 92.3%
  • Nix 4.1%
  • Just 3%
  • Dockerfile 0.6%
Find a file
Fergus Molloy a3ae282bd3
Some checks failed
Build / Build (push) Successful in 2m10s
Build / Unit tests (push) Successful in 2m10s
Build / Integration tests (push) Failing after 2m10s
Build / Lint (push) Failing after 2m10s
Build / Build Docker Image (push) Has been skipped
Build / Deploy Dev (push) Has been skipped
Build / Deploy Prod (push) Has been skipped
add created at time to message
2026-03-19 11:30:30 +00:00
.forgejo/workflows update CLAUDE.md and readme.md to reflect current project status 2026-03-17 09:14:50 +00:00
cmd add wal protobuf and move generated files 2026-03-19 08:56:22 +00:00
deploy add version to output of build and push 2026-03-16 22:50:32 +00:00
gen add wal protobuf and move generated files 2026-03-19 08:56:22 +00:00
internal add created at time to message 2026-03-19 11:30:30 +00:00
proto add wal protobuf and move generated files 2026-03-19 08:56:22 +00:00
tests add wal protobuf and move generated files 2026-03-19 08:56:22 +00:00
.gitignore move main.go s to cmd/<app>/main.go and update build files to reflect 2026-02-12 22:50:04 +00:00
.golangci.yml add test and fix lints 2026-01-16 23:16:18 +00:00
CLAUDE.md update CLAUDE.md and readme.md to reflect current project status 2026-03-17 09:14:50 +00:00
config.test.yml fix pipeline 2026-02-20 11:16:21 +00:00
config.yaml.example Add YAML configuration with environment variable overrides 2026-01-21 15:50:31 +00:00
flake.lock swap flake to unstable 2026-03-07 10:18:29 +00:00
flake.nix swap flake to unstable 2026-03-07 10:18:29 +00:00
go.mod migrate to grpc and clean up dead code 2026-03-16 22:50:31 +00:00
go.sum migrate to grpc and clean up dead code 2026-03-16 22:50:31 +00:00
Justfile add wal protobuf and move generated files 2026-03-19 08:56:22 +00:00
LICENSE add license 2026-03-16 22:50:33 +00:00
PLAN.md add plan.md with options for handling load balancing across mulitple kuberenets pods 2026-03-06 11:05:11 +00:00
readme.md update CLAUDE.md and readme.md to reflect current project status 2026-03-17 09:14:50 +00:00

Very Fast Message Processor (VFMP)

A lightweight, high-throughput message broker built in Go. VFMP is designed to be simple to operate and scale horizontally, providing reliable at-least-once message delivery with minimal overhead.

Goals

  • High throughput: In-memory linked-list queues with no serialisation overhead on the hot path
  • At-least-once delivery: Lease-based acknowledgement ensures messages are redelivered if a consumer crashes or times out
  • Simple operations: Single binary, YAML config, Prometheus metrics out of the box
  • Scalable consumption: gRPC server-streaming lets consumers pull batches of messages efficiently

How it works

Publishers send messages over HTTP. Consumers pull messages via gRPC and acknowledge each one with a lease token. If a consumer fails to acknowledge within 10 seconds the message is automatically requeued. After 3 failed delivery attempts a message is moved to a dead-letter queue (DEADLETTER/<topic>) for inspection.

Publisher                  VFMP                     Consumer
   |                        |                           |
   |-- POST /messages/foo ->|                           |
   |                        |-- Consume(foo, n) ------->|
   |                        |<-- stream: msg+lease -----|
   |                        |                           | (process)
   |                        |<-- Ack(lease_token) ------|
   |                        |                           |

Quick start

# Start the server (HTTP :8080, gRPC :9090, metrics :5050)
just run

# Publish a message
curl -X POST http://localhost:8080/messages/my-topic \
  -H "X-Correlation-ID: $(uuidgen)" \
  -d "hello world"

# Check queue length
curl "http://localhost:8080/messages/my-topic?data=count"

# Consume messages (ACK each one)
just client -address localhost:9090 -topic my-topic

# Check queue length again
curl "http://localhost:8080/messages/my-topic?data=count"

Configuration

Configuration is loaded from a YAML file, environment variables, or flags — in that order of precedence.

Field Env var Default Description
http_addr HTTP_ADDR :8080 HTTP API listener
tcp_addr TCP_ADDR :9090 gRPC listener
metrics_addr PPROF_ADDR :5050 Prometheus metrics listener
log_level LOG_LEVEL debug Log level (debug/info/warn)
log_path LOG_PATH Optional log file path
shutdown_timeout SHUTDOWN_TIMEOUT 10s Graceful shutdown window

API

HTTP

Method Path Description
POST /messages/{topic} Publish a message (requires X-Correlation-ID header)
GET /messages/{topic}?data=count Queue length for a topic
GET /messages/{topic}?data=peek Peek at the next message
GET /control/healthcheck Health check
GET /control/version Server version

gRPC (vfmp.v1.MessageService)

RPC Description
Consume Server-streaming: receive up to N messages from a topic
Ack Confirm successful processing — message permanently removed
Nck Signal failure — message immediately requeued for redelivery
Dlq Dead-letter a message — moved to DEADLETTER/<topic>

Proto definitions are in proto/vfmp/v1/messages.proto. Regenerate with just proto.