A unified Go library for working with message queues and pub/sub systems across different backends.
- Abstract Interfaces: Unified
Publisher,Subscriber, andQueueinterfaces - Pluggable Backends: Support for multiple message queue systems
- Factory Pattern: Easy creation of publishers and subscribers
- Comprehensive Configuration: Rich configuration options for each backend
- Thread-Safe: All operations are thread-safe and concurrent-friendly
- Error Handling: Robust error handling with retry mechanisms
- Graceful Shutdown: Proper resource cleanup and graceful shutdown
- Minimal Dependencies: Lightweight with minimal external dependencies
- Idiomatic Go: Follows Go best practices and conventions
| Backend | Status | Description |
|---|---|---|
| Kafka | ✅ Implemented | Apache Kafka with full producer/consumer support |
| NATS | 🚧 Planned | NATS messaging system |
| Redis | 🚧 Planned | Redis pub/sub and queue operations |
| RabbitMQ | 🚧 Planned | RabbitMQ message broker |
| AWS SQS | 🚧 Planned | Amazon Simple Queue Service |
| Asynq | 🚧 Planned | Redis-based distributed task queue |
go get github.com/zulkhair/gomqlibimport (
"context"
"encoding/json"
"log"
"time"
"github.com/zulkhair/gomqlib/pkg/adapter"
"github.com/zulkhair/gomqlib/pkg/factory"
"github.com/zulkhair/gomqlib/pkg/kafka"
)