Skip to main content
Version: 3.0.0-alpha (Diátaxis)

Concepts — RabbitMQ

Architecture

RabbitMQ on Hikube is a managed messaging service based on the AMQP protocol. Each instance deployed via the RabbitMQ resource creates a high-availability cluster with quorum queues (Raft protocol) for message replication.


Terminology

TermDescription
RabbitMQKubernetes resource (apps.cozystack.io/v1alpha1) representing a managed RabbitMQ cluster.
AMQPAdvanced Message Queuing Protocol — standard messaging protocol supported by RabbitMQ.
ExchangeMessage entry point. Routes messages to queues via bindings.
QueueMessage buffer that stores messages until a consumer processes them.
BindingRouting rule between an exchange and a queue (based on a routing key).
Quorum QueueQueue type using the Raft protocol to replicate messages across multiple nodes.
Virtual Host (vhost)Logical namespace that isolates exchanges, queues, and permissions within the same cluster.
ConsumerApplication that reads and processes messages from a queue.
resourcesPresetPredefined resource profile (nano to 2xlarge).

Message routing

RabbitMQ uses a flexible routing model based on exchanges and bindings:

Exchange types

TypeRouting
directExact routing key
topicPattern matching with wildcards (*, #)
fanoutBroadcast to all bound queues
headersRouting based on message headers

Quorum queues and high availability

Quorum queues use the Raft protocol to replicate messages:

  1. A node is elected leader for each queue
  2. Messages are replicated to followers before confirmation
  3. If the leader fails, a follower is automatically promoted
tip

Configure replicas: 3 minimum to guarantee Raft quorum and high availability of quorum queues.


Virtual Hosts

Vhosts isolate resources within the same cluster:

  • Each vhost has its own exchanges, queues, and permissions
  • Users can have different roles per vhost: admin or readonly
  • Useful for separating environments (production, staging) on the same cluster

User management

Users are declared in the manifest with:

  • Password for authentication
  • Roles per vhost: admin (read/write/configure), readonly (read-only)

Credentials are stored in the Secret <instance>-credentials.


Resource presets

PresetCPUMemory
nano250m128Mi
micro500m256Mi
small1512Mi
medium11Gi
large22Gi
xlarge44Gi
2xlarge88Gi

Limits and quotas

ParameterValue
Max replicasDepending on tenant quota
Storage size (size)Variable (in Gi)
Vhosts per clusterUnlimited (depending on resources)
Supported protocolsAMQP 0-9-1, AMQP 1.0, MQTT, STOMP

Further reading