製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗OtterMQ is a high-performance message broker written in Go, inspired by RabbitMQ. It aims to provide a reliable, scalable, and easy-to-use messaging solution for distributed systems. OtterMQ is being developed with the goal of full compliance with the AMQP 0.9.1 protocol, ensuring compatibility with existing tools and workflows. It also features a modern management UI built with SvelteKit.
OtterMq already supports basic interoperability with RabbitMQ clients, including:
The name "OtterMQ" comes from my son's nickname and is a way to honor him. He brings joy and inspiration to my life, and this project is a reflection of that. And, of course, it is also a pun on RabbitMQ.
/metrics exporterottermqadmin CLI tool (Cobra-based)docker-composegit clone https://github.com/ottermq/ottermq.git
cd ottermq
make build-all && make install
# Run the broker:
make run-dev
# In another terminal, run the UI (http://localhost:5173, proxies /api to :3000):
cd web/ui
npm install
npm run dev
# If the broker's web API listens elsewhere:
# OTTERMQ_API_URL=http://localhost:3100 npm run dev
# Build everything (UI + broker + CLI):
make build-all
# Run the integrated server:
make run
make build # Build broker only
make build-admin # Build ottermqadmin only
make build-all # Build UI, broker, and CLI
make install-admin # Install ottermqadmin into GOPATH/bin
make run # Run broker (with embedded UI if built)
make test-cli # Run focused CLI tests
make run-dev # Run broker in development mode
make test # Run all tests
make lint # Run code quality checks
make clean # Clean all build artifacts
make docs # Generate API documentation
OtterMq uses:
Port 5672 for the AMQP broker
Port 3000 for the management UI
OtterMQ now includes ottermqadmin, a Cobra-based admin CLI that talks to the same HTTP management API used by the web UI.
make build-admin
make install-admin
Or run it directly from the repo:
go run ./cmd/ottermqadmin --help
go run ./cmd/ottermqadmin overview --username guest --password guest
go run ./cmd/ottermqadmin queues list --username guest --password guest
go run ./cmd/ottermqadmin exchanges list --username guest --password guest
go run ./cmd/ottermqadmin bindings list --username guest --password guest
go run ./cmd/ottermqadmin queues create / jobs --durable --username guest --password guest
go run ./cmd/ottermqadmin publish / "" --routing-key jobs --body "hello" --username guest --password guest
go run ./cmd/ottermqadmin queues get-messages / jobs --count 5 --ack-mode ack --username guest --password guest
go run ./cmd/ottermqadmin connections list --username guest --password guest
go run ./cmd/ottermqadmin channels list --username guest --password guest
go run ./cmd/ottermqadmin consumers list --username guest --password guest
Notes:
ottermqadmin targets the management API, so the OtterMQ web API must be enabled and reachable.http://localhost:3000."" or "(AMQP default)" as the exchange argument when publishing to the AMQP default exchange.--json to any command for machine-readable output.OtterMQ can be configured using environment variables or a .env file. Environment variables take precedence over .env file settings, which in turn take precedence over default values.
Copy .env.example to .env and customize as needed:
cp .env.example .env
Available configuration options:
| Environment Variable | Default | Description |
|---|---|---|
OTTERMQ_BROKER_PORT | 5672 | AMQP broker port |
OTTERMQ_BROKER_HOST | `` | Broker bind address (empty = all interfaces) |
OTTERMQ_USERNAME | guest | Bootstrap admin user, created on start if it doesn't exist (the password of an existing user is not changed) |
OTTERMQ_PASSWORD | guest | Password of the bootstrap admin user |
OTTERMQ_LOOPBACK_USERS | guest | Comma-separated users that may only connect from localhost (AMQP and web API); set it empty to restrict nobody. Behind a reverse proxy or TLS terminator on the same host, every client looks local |
OTTERMQ_HEARTBEAT_INTERVAL | 60 | Heartbeat interval in seconds |
OTTERMQ_CHANNEL_MAX | 2048 | Maximum number of channels |
OTTERMQ_FRAME_MAX | 131072 | Maximum frame size in bytes |
OTTERMQ_SSL | false | Enable SSL/TLS |
OTTERMQ_QUEUE_BUFFER_SIZE | 100000 | Queue message buffer size |
OTTERMQ_WEB_PORT | 3000 | Web management UI port |
OTTERMQ_JWT_SECRET | generated | Key that signs web API tokens, at least 32 bytes. Unset, a random key is generated on first start and kept in <data dir>/jwt.key |
OTTERMQ_INSECURE_DEV | false | Accept a weak OTTERMQ_JWT_SECRET (such as secret), for local development only |
Create a .env file in the project root:
OTTERMQ_BROKER_PORT=5672
OTTERMQ_WEB_PORT=8080
OTTERMQ_USERNAME=admin
OTTERMQ_PASSWORD=secure_password
OTTERMQ_QUEUE_BUFFER_SIZE=200000
# Optional; generated in the data dir if unset. At least 32 bytes, e.g. `openssl rand -hex 32`.
# OTTERMQ_JWT_SECRET=
Or use environment variables directly:
export OTTERMQ_BROKER_PORT=15672
export OTTERMQ_WEB_PORT=8080
ottermq
Images are published to the GitHub Container Registry: latest from main (the latest release), a version tag (e.g. 0.20.0 and 0.20) for each v* release tag, and edge from dev, which has every merged change but isn't released yet.
docker run -p 5672:5672 -p 3000:3000 \
-e OTTERMQ_USERNAME=admin -e OTTERMQ_PASSWORD='<choose a password>' \
ghcr.io/ottermq/ottermq:latest
Set OTTERMQ_USERNAME and OTTERMQ_PASSWORD: the default guest user may only connect from
localhost, and connections from the host reach the container from the Docker bridge, not from
loopback, so guest is refused there. The broker creates the configured user as an administrator
on start if it doesn't exist yet, also on an existing data dir; it doesn't change the password of an
existing user.
To build and run from source instead:
docker compose up --build
This uses packaging/docker/Dockerfile and docker-compose.yml. Uncomment and set
OTTERMQ_USERNAME/OTTERMQ_PASSWORD in docker.env first, for the same reason.
OtterMq is under active development. All core AMQP 0.9.1 features, RabbitMQ extensions, observability, and the management API are complete. Active work is on finishing the ottermqadmin CLI tool.
Remaining CLI commands: users and permissions (the HTTP API for both already exists).
Longer-term planned work:
All core AMQP 0.9.1 message operations are now fully implemented, including:
basic.consume/basic.deliver)basic.get)basic.ack, basic.nack, basic.reject)basic.qos)basic.recover, basic.recover-async)channel.flow for backpressure management)tx.select, tx.commit, tx.rollback)RabbitMQ Extensions (for compatibility):
x-death trackingconsumer_cancel_notify) when a queue is deletedBasic compatibility with RabbitMQ clients is functional and tested. See ROADMAP.md for detailed development plans.
OtterMq provides a built-in Swagger UI for exploring and testing the API.
Access it at: http://<server-address>/docs
If you make changes to the API and need to regenerate the documentation, run:
make docs
This will update the Swagger spec and refresh the documentation served at /docs.
OtterMQ provides a comprehensive REST API for managing queues, exchanges, bindings, and monitoring broker state. The API supports all broker features including TTL, DLX, QLL, and QoS.
Create a queue with TTL and DLX:
curl -X POST http://localhost:3000/api/queues/my-vhost/my-queue \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"durable": true,
"auto_delete": false,
"arguments": {
"x-message-ttl": 60000,
"x-dead-letter-exchange": "dlx-exchange",
"x-max-length": 10000
}
}'
List all queues:
curl http://localhost:3000/api/queues \
-H "Authorization: Bearer <token>"
Get queue details:
curl http://localhost:3000/api/queues/my-vhost/my-queue \
-H "Authorization: Bearer <token>"
Create a topic exchange:
curl -X POST http://localhost:3000/api/exchanges/my-vhost/my-exchange \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"type": "topic",
"durable": true,
"auto_delete": false,
"internal": false
}'
Bind a queue to an exchange:
curl -X POST http://localhost:3000/api/bindings \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"vhost": "my-vhost",
"source": "my-exchange",
"destination": "my-queue",
"routing_key": "events.#"
}'
Publish a message:
curl -X POST http://localhost:3000/api/exchanges/my-vhost/my-exchange/publish \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"routing_key": "events.user.created",
"payload": "Hello, OtterMQ!",
"content_type": "text/plain",
"delivery_mode": 2,
"priority": 5
}'
Get messages from a queue:
curl -X POST http://localhost:3000/api/queues/my-vhost/my-queue/get \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"message_count": 10,
"ack_mode": "ack"
}'
Get broker overview:
curl http://localhost:3000/api/overview \
-H "Authorization: Bearer <token>"
List active consumers:
curl http://localhost:3000/api/consumers \
-H "Authorization: Bearer <token>"
List active connections:
curl http://localhost:3000/api/connections \
-H "Authorization: Bearer <token>"
List channels:
curl http://localhost:3000/api/channels \
-H "Authorization: Bearer <token>"
For complete API reference, see the Swagger documentation at /docs.
We publish a live status site that tracks protocol/class/method support, planned work, and compatibility notes—similar to RabbitMQ’s specification page.
/docs folderpages (GitHub Pages is configured to build from pages with /docs as the site root)Notes:
/docs by the running server. The Pages site documents status and specs; the Swagger UI documents the REST API./docs and merge it into the pages branch so the site stays current.Contributions are welcome! See CONTRIBUTING.md to get set up. Good places to start:
OtterMQ is released under the MIT License. See License for more information.
For questions, suggestions, or issues, please open an issue in the GitHub repository.