Skip to content

Provisioning RabbitMQ#

Ametnes-managed RabbitMQ is a private message broker. The management console is served over HTTPS, and AMQP clients connect over AMQPS on port 5671.

Prerequisites#

  1. A service location (see Service Location).

Networking is automatic by default

Creating a network access resource is optional. If you do not create one, Ametnes manages network access for the location and your service attaches to it automatically. Create your own only if you want to control exposure (see Network Access Resources).

Create the RabbitMQ service#

Kinds: service/rabbitmq:4.3 and service/rabbitmq:4.2. The administrator credentials are required.

  1. Navigate to Services and click New Service.
  2. Name it (for example RabbitMQService).
  3. Kind: RabbitMQ 4.3 Message Broker.
  4. Location: your data service location. Leave Network unset to let Ametnes manage it.
  5. Architecture: Starter for evaluation, Basic+ for a clustered, highly available broker.
  6. Set Admin User (lowercase, 5+ characters, e.g. admin) and Admin Password.
  7. Click Create Service and wait for ready.
service.tf
resource "ametnes_service" "rabbitmq" {
  name    = "RabbitMQService"
  project = ametnes_project.project.id
  location = data.ametnes_location.location.id
  kind    = "service/rabbitmq:4.3"
  nodes   = 3
  capacity {
    storage = 50
  }
  config = {
    "architecture"   = "Basic"
    "admin.user"     = "admin"
    "admin.password" = "change-me"
  }
}

output "connections" { value = ametnes_service.rabbitmq.connections }

Connect#

The service publishes two connections:

Connection Port Use
https 443 Management console / HTTP API.
amqps 5671 AMQP clients.

Connect with amqps://:

amqps://admin:<password>@<host>:<port>/
import pika

params = pika.URLParameters("amqps://admin:<password>@<host>:<port>/")
pika.BlockingConnection(params)

The federation and shovel plugins (used by disaster recovery) ship with the broker and are enabled by default, so either cluster can join a DR link.

Queue type

Queues default to quorum (default_queue_type = quorum), so a clustered tier replicates them across its nodes automatically. Clients can still pin a type per queue with arguments={"x-queue-type": "quorum"} (or classic); the type is immutable once the queue is declared.

Next#

  • Disaster recovery — link a secondary cluster with federation and fail over.
  • Scaling — tiers, cluster size and version upgrades.