Messaging & Event Streaming (RabbitMQ & Apache Kafka)
Okustera Messaging & Event Streaming provides two managed, open-standard distributed messaging engines provisioned declaratively through the Cloud Portal (/messaging), REST API (/api/v1/messaging/*), or Terraform:
- Managed RabbitMQ: Low-latency task brokering, AMQP/MQTT/STOMP routing, and high-availability Raft Quorum Queues.
- Managed Apache Kafka (KRaft Mode): High-throughput, immutable distributed commit logs and real-time event streaming running in modern ZooKeeper-less KRaft consensus mode.

1. Managed RabbitMQ
Architectural Highlights
- Raft Quorum Queues: Replicated FIFO queues providing consensus-based data durability and automatic failover.
- Protocol Versatility: Native support for AMQP 0-9-1, AMQP 1.0, MQTT 3.1.1, STOMP, and WebSockets.
- Integrated Observability: Built-in Prometheus metrics exposing queue depth, publish/delivery rates, and consumer acknowledgments in your tenant Grafana workspace.
- Event-Driven Consumer Scaling: Scale consumer workloads dynamically based on queue depth metrics.
Declarative Provisioning via Terraform
resource "okustera_rabbitmq_cluster" "production_broker" {
name = "production-broker"
namespace = "my-app"
replicas = 3
storage_gb = 20
}
Learn more in the okustera_rabbitmq_cluster Terraform Reference.
Python (pika) Publishing Example
import os
import pika
credentials = pika.PlainCredentials(
os.environ["RABBITMQ_USER"],
os.environ["RABBITMQ_PASSWORD"],
)
parameters = pika.ConnectionParameters(
host=os.environ["RABBITMQ_HOST"],
port=int(os.environ.get("RABBITMQ_PORT", "5672")),
virtual_host="/",
credentials=credentials,
)
connection = pika.BlockingConnection(parameters)
channel = connection.channel()
# Declare a durable Raft quorum queue
channel.queue_declare(
queue="orders-queue",
durable=True,
arguments={"x-queue-type": "quorum"},
)
channel.basic_publish(
exchange="",
routing_key="orders-queue",
body='{"order_id": 9821, "status": "pending"}',
properties=pika.BasicProperties(delivery_mode=2),
)
print("Order published successfully")
connection.close()
2. Managed Apache Kafka (KRaft Mode)
Architectural Highlights
- ZooKeeper-less KRaft Consensus: Self-managed Raft metadata quorum for simplified operations, faster controller failover, and higher partition scalability.
- Partitioned Commit Logs & Replayability: Configurable default partition counts, in-sync replication factors, and time-based log retention backed by replicated NVMe storage.
- Dual Listeners: Private service discovery supporting plaintext (
:9092) and TLS-encrypted (:9093) connections. - Managed Lifecycle: Provision, inspect, and decommission clusters through the Cloud Portal (
/messaging), REST API (/api/v1/messaging/kafka), or Terraform.
Declarative Provisioning via Terraform
resource "okustera_kafka_cluster" "telemetry_stream" {
name = "telemetry-stream"
namespace = "my-app"
replicas = 3
storage_gb = 50
num_partitions = 6
replication_factor = 3
retention_hours = 168
}
Learn more in the okustera_kafka_cluster Terraform Reference.
Python (kafka-python) Producer Example
import json
import os
from kafka import KafkaProducer
bootstrap_servers = os.environ["KAFKA_BOOTSTRAP_SERVERS"]
producer = KafkaProducer(
bootstrap_servers=[bootstrap_servers],
value_serializer=lambda v: json.dumps(v).encode("utf-8"),
acks="all",
)
future = producer.send(
"billing.usage.events",
{"tenant_id": "tenant-demo-01", "metric": "api.requests", "count": 4096},
)
record_metadata = future.get(timeout=10)
print(
f"Published to {record_metadata.topic} "
f"partition {record_metadata.partition} @ offset {record_metadata.offset}"
)
producer.close()
3. REST API Reference
GET /api/v1/messaging/clusters— List managed RabbitMQ clusters in the tenant project.POST /api/v1/messaging/clusters— Provision a new high-availability RabbitMQ quorum cluster.GET /api/v1/messaging/clusters/{namespace}/{name}— Inspect RabbitMQ cluster endpoints and credentials.DELETE /api/v1/messaging/clusters/{namespace}/{name}— Decommission a RabbitMQ cluster.GET /api/v1/messaging/kafka— List managed Apache Kafka (KRaft) clusters in the tenant project.POST /api/v1/messaging/kafka— Provision a new Apache Kafka KRaft event streaming cluster.GET /api/v1/messaging/kafka/{namespace}/{name}— Inspect Kafka bootstrap endpoints (:9092/:9093), partitions, replication factor, and retention policy.DELETE /api/v1/messaging/kafka/{namespace}/{name}— Decommission an Apache Kafka cluster.