A high-performance AMQP 0.9.1 message broker implementation written in Go. Compatible with RabbitMQ clients and tools.
- ✅ Full AMQP 0.9.1 protocol implementation
- ✅ Compatible with RabbitMQ clients (Go, Python, Node.js, etc.)
- ✅ Multiple exchange types (direct, fanout, topic, headers)
- ✅ Persistent and non-persistent messages
- ✅ Multiple storage backends (memory, Badger)
- ✅ SASL authentication (PLAIN, ANONYMOUS)
- ✅ Transaction support
- ✅ High performance (3M+ ops/sec in-memory)
- ✅ Prometheus metrics integration
Download the latest release for your platform from the releases page.
# macOS/Linux
chmod +x amqp-server-*
sudo mv amqp-server-* /usr/local/bin/amqp-server
# Verify installation
amqp-server --versiongit clone https://github.com/maxpert/strangeq.git
cd strangeq/src/amqp-go
go build -o amqp-server ./cmd/amqp-server
sudo mv amqp-server /usr/local/bin/go install github.com/maxpert/amqp-go/cmd/amqp-server@latest# In-memory mode (development)
amqp-server
# With persistent storage (production)
amqp-server --storage badger --storage-path ./data
# With configuration file
amqp-server --config config.jsonimport pika
connection = pika.BlockingConnection(
pika.ConnectionParameters('localhost')
)
channel = connection.channel()
# Declare queue
channel.queue_declare(queue='hello')
# Publish message
channel.basic_publish(
exchange='',
routing_key='hello',
body='Hello World!'
)
print(" [x] Sent 'Hello World!'")
connection.close()const amqp = require('amqplib');
async function main() {
const connection = await amqp.connect('amqp://localhost');
const channel = await connection.createChannel();
await channel.assertQueue('hello');
channel.sendToQueue('hello', Buffer.from('Hello World!'));
console.log(" [x] Sent 'Hello World!'");
await connection.close();
}
main().catch(console.error);package main
import (
"log"
amqp "github.com/rabbitmq/amqp091-go"
)
func main() {
conn, err := amqp.Dial("amqp://guest:guest@localhost:5672/")
if err != nil {
log.Fatal(err)
}
defer conn.Close()
ch, err := conn.Channel()
if err != nil {
log.Fatal(err)
}
defer ch.Close()
q, err := ch.QueueDeclare("hello", false, false, false, false, nil)
if err != nil {
log.Fatal(err)
}
err = ch.Publish("", q.Name, false, false, amqp.Publishing{
ContentType: "text/plain",
Body: []byte("Hello World!"),
})
if err != nil {
log.Fatal(err)
}
log.Println(" [x] Sent 'Hello World!'")
}See CLIENT_EXAMPLES.md for complete examples including consumers, exchanges, and advanced patterns.
amqp-server [options]
Options:
--port PORT Server port (default: 5672)
--storage BACKEND Storage backend: memory|badger (default: memory)
--storage-path PATH Storage directory (default: ./data)
--config FILE Configuration file path
--auth Enable authentication
--auth-file FILE Authentication file path
--log-level LEVEL Log level: debug|info|warn|error (default: info)
--log-file FILE Log file path (default: stdout)Create config.json:
{
"network": {
"address": ":5672",
"max_connections": 1000
},
"storage": {
"backend": "badger",
"path": "./data",
"persistent": true
},
"security": {
"authentication_enabled": true,
"authentication_config": {
"user_file": "users.json"
}
},
"server": {
"log_level": "info",
"max_frame_size": 131072
}
}Run with config:
amqp-server --config config.jsonBenchmarks on Apple M4 Max (16 cores):
| Operation | Throughput | Latency |
|---|---|---|
| Message Publishing (memory) | 2.9M ops/sec | 344 ns/op |
| Exchange Declaration | 3.2M ops/sec | 309 ns/op |
| Queue Declaration | 2.8M ops/sec | 357 ns/op |
| Message Publishing (persistent) | 15K ops/sec | 66 μs/op |
See docs/BENCHMARKS.md for detailed performance analysis.
# Copy service file
sudo cp deployment/systemd/amqp-server.service /etc/systemd/system/
# Enable and start
sudo systemctl enable amqp-server
sudo systemctl start amqp-server
# Check status
sudo systemctl status amqp-serverThe repository includes a docker-compose file for testing compatibility with RabbitMQ:
cd src/amqp-go/protocol
docker-compose upThis is used for protocol testing and interoperability verification only.
StrangeQ exposes Prometheus metrics on port 9419:
curl http://localhost:9419/metricsKey metrics:
amqp_connections_total- Total active connectionsamqp_messages_published_total- Total messages publishedamqp_messages_delivered_total- Total messages deliveredamqp_messages_acknowledged_total- Total message acknowledgments
- Client Examples - Complete examples for Python, Node.js, and Go
- Configuration Guide - Detailed configuration options
- Authentication Setup - Setting up user authentication
- Development Plan - Project roadmap and implementation status
- Contributing Guidelines - How to contribute
- Security Policy - Security best practices
StrangeQ implements AMQP 0.9.1 specification with support for:
- Connection management (negotiation, heartbeat, flow control)
- Channel operations (multiple channels per connection)
- Exchange types (direct, fanout, topic, headers)
- Queue operations (declare, bind, purge, delete)
- Message publishing (persistent and non-persistent)
- Message consumption (Basic.Get, Basic.Consume)
- Message acknowledgment (Basic.Ack, Basic.Nack, Basic.Reject)
- Transactions (Tx.Select, Tx.Commit, Tx.Rollback)
StrangeQ is compatible with all standard AMQP 0.9.1 clients:
- Python:
pika,aio-pika - Node.js:
amqplib - Go:
amqp091-go,streadway/amqp - Java: Spring AMQP, RabbitMQ Java Client
- Ruby:
bunny - .NET: RabbitMQ .NET Client
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
- Report bugs: GitHub Issues
- Security issues: See SECURITY.md