A fault-tolerant, distributed job processing engine built in Go. Built for teams who can't afford to lose a single job.
Processing everything inside a synchronous HTTP request is fragile:
β Timeouts kill long-running work
β Retries duplicate side effects
β A single crash silently swallows jobs
GoQueue solves this by decoupling job creation from job execution:
β
Persists every job to PostgreSQL the moment it's created
β
Pushes to Redis for fast async dispatch
β
Executes through concurrent Go workers
β
Full crash recovery, priority scheduling, and tracing built in
| Feature | Description |
|---|---|
| ποΈ Dual-layer persistence | PostgreSQL for durability Β· Redis for throughput |
| π· Concurrent worker pools | Scalable goroutine-based workers process jobs in parallel |
| π Smart retry + backoff | Non-blocking delayed queues with exponential backoff |
| β οΈ Dead Letter Queue | Permanently failed jobs routed for inspection and replay |
| π Crash recovery | Visibility timeouts + Reaper service recover stuck jobs |
| π― Priority dispatching | High Β· Medium Β· Low priority queues |
| π Idempotency keys | Safe job creation - no accidental duplicates |
| π Correlation IDs | Every job traceable end-to-end via structured JSON logs |
| π Backpressure shedding | Returns HTTP 429 when queue capacity is exceeded |
| π Full observability | Prometheus metrics + Grafana dashboards out of the box |
| π§Ή Graceful shutdown | Workers drain in-flight jobs safely on termination signals |
End-to-end architecture of GoQueue showing job creation, reliable delivery, distributed workers, retry orchestration, crash recovery, and observability.
The fastest way to run GoQueue is via Docker Compose - spins up the API, workers, PostgreSQL, Redis, Prometheus, and Grafana in one command.
- π³ Docker & Docker Compose
make(optional but recommended)
git clone https://github.com/bhusaremayur/goqueue.git
cd goqueue# With Docker Compose
docker-compose -f deployments/docker-compose.yml up -d
# Or with Make
make updocker-compose ps| Service | URL | Description |
|---|---|---|
| π’ Go API Server | http://localhost:8080 |
Job submission & status |
| π Grafana Dashboard | http://localhost:3000 |
Pre-built dashboards |
| π Prometheus | http://localhost:9090 |
Raw metrics |
goqueue/
β
βββ cmd/
β βββ api/ β API server entry point
β βββ worker/ β Worker process entry point
β βββ example-app/ β Example usage
β
βββ internal/
β βββ job/ β Core job domain logic
β βββ storage/
β β βββ postgres/ β PostgreSQL repositories
β β β βββ migrations/ β SQL schema migrations
β β βββ redis/ β Redis queue implementation
β βββ scheduler/ β Job scheduling logic
β βββ reaper/ β Crash recovery service
β
βββ pkg/
β βββ logging/ β Structured JSON logger
β βββ metrics/ β Prometheus metric definitions
β βββ middleware/ β HTTP middleware (correlation IDs, etc.)
β βββ retry/ β Exponential backoff policies
β
βββ deployments/
βββ docker-compose.yml
βββ prometheus.yml
GoQueue treats observability as a first-class concern - not an afterthought.
Every log line carries a correlation_id for full request traceability:
{
"level": "info",
"correlation_id": "REQ-8472",
"event": "job_processed",
"job_id": "a1b2c3",
"queue": "high",
"worker": "worker-1",
"duration_ms": 142
}Exposed at /metrics - all critical signals tracked:
goqueue_jobs_enqueued_total β Total jobs submitted
goqueue_jobs_processed_total β Successfully processed
goqueue_jobs_failed_total β Failed jobs (by queue)
goqueue_queue_depth β Current queue depth (by priority)
goqueue_worker_utilization β Worker pool saturation %
goqueue_retry_count β Retry attempts in flight
goqueue_dlq_size β Dead Letter Queue depth
goqueue_processing_latency_seconds β Job processing duration histogram
Pre-built dashboards ship with the repo.
open http://localhost:3000 # after docker-compose upTested with k6 at high concurrency:
βββββββββββββββββββββββββββββββββββββββββββββββ
β Load Test Summary (k6) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββ€
β Virtual Users β 10,000 β
β Total Requests β 40,000+ β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ€
β Backpressure (429) β β
Validated β
β Crash Recovery β β
All jobs back β
β DLQ Routing β β
Clean isolation β
ββββββββββββββββββββββββ΄βββββββββββββββββββββββ
Language β Go
Persistence β PostgreSQL
Queue / Cache β Redis
Observability β Prometheus + Grafana
Infrastructure β Docker + Docker Compose
Contributions are welcome - bug reports, feature suggestions, and pull requests alike.
- Fork the repository
- Create a feature branch:
git checkout -b feat/your-feature - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feat/your-feature - Open a Pull Request
Please read CONTRIBUTING.md before submitting - it covers running the test suite locally and the PR process.
Licensed under the terms in LICENSE.
GoQueue v1.0
Built with β€οΈ using Go Β· Redis Β· PostgreSQL Β· Prometheus Β· Grafana
β Star this repo if GoQueue helped you! β
