Kafka, RabbitMQ, NATS.
kubectl apply - that's it.
Three fully managed messaging services on Hikube. Distributed event streaming, AMQP task queues, ultra-light pub/sub. Automatic replication, coordinated ZooKeeper, JetStream included.
3 services
Native HA
>1 ms
0 config
The right service for every pattern
Kafka, RabbitMQ and NATS meet distinct needs. The choice depends on volume, delivery model and durability.
Each service in detail
Kafka
Kafka organizes messages into topics divided into partitions, distributed across several brokers. Each partition is replicated according to the replicationFactor. In the event of a broker failure, partitions are redirected to available replicas. ZooKeeper coordinates the election of leaders and stores cluster metadata.
Unlike RabbitMQ, Kafka retains messages after they have been consumed. The retention time is configurable per topic (retention.ms). Several consumer groups can read the same topic independently, each maintaining its own offset.
- Topics declared in the manifest
Partitions, replication factor, retention and cleanup policy configured directly in YAML. No need for external tools to create topics. - Managed ZooKeeper
3 ZooKeeper instances coordinate the cluster automatically. Odd quorum is guaranteed - a ZK node failure does not interrupt service. - Retention and compaction
cleanup.policy: delete deletes messages after retention.ms. cleanup.policy: compact retains only the last message per key, ideal for reference tables. - Optional external exposure
external: true creates one LoadBalancer per broker for off-cluster clients. Avoid without authentication configured.
apiVersion: apps.cozystack.io/v1alpha1
kind: Kafka
metadata:
name: example
spec:
external: false
kafka:
replicas: 3
resourcesPreset: small
size: 10Gi
storageClass: replicated
zookeeper:
replicas: 3 # Toujours impair
resourcesPreset: small
size: 5Gi
storageClass: replicated
topics:
- name: my-topic
partitions: 3
replicas: 3
config:
retention.ms: "604800000" # 7 jours
cleanup policy: "delete"
RabbitMQ
RabbitMQ routes messages via exchanges - producers publish to an exchange, which distributes to queues according to binding rules (direct, fanout, topic, headers). Consumers read from the queues. This flexible routing model makes RabbitMQ the best choice for complex workflows where the path of a message depends on its content.
With 3 replicas, RabbitMQ uses quorum queues (Raft protocol) - messages are replicated before confirmation, guaranteeing durability even in the event of a node failure.
- Default quorum
Raft replication on all 3 nodes. One leader node, two followers. Loss of one node without loss of messages. - Virtual hosts and isolation
Each vhost has its own exchanges, queues and permissions. Useful for separating environments (production, staging) on the same cluster. - Management UI included
Web interface on port 15672 - visualize queues, exchange bindings and throughput in real time. Accessible via port-forward or LoadBalancer. - Multi-protocol
AMQP 0-9-1, AMQP 1.0, MQTT and STOMP natively supported.
apiVersion: apps.cozystack.io/v1alpha1
kind: RabbitMQ
metadata:
name: example
spec:
replicas: 3
resourcesPreset: small
size: 10Gi
storageClass: replicated
users:
admin:
password: "strongpassword"
vhosts:
production:
roles:
admin:
- admin
readonly:
- monitoring
staging:
roles:
admin:
- admin
readonly:
- monitoring
NATS
NATS is the lightest of the three - less than 10 MB RAM per instance, latency measured in microseconds. Messages are published on hierarchical subjects (e.g. orders.created) that subscribers listen to. Without JetStream, NATS operates as a fire-and-forget system: only subscribers connected at the time of publication receive the message.
JetStream adds persistence - messages are stored in streams with configurable retention, replay capability, and durable consumer groups with offset tracking. The cluster uses Raft consensus to replicate streams.
-
Pub/Sub and Request/Reply
Asynchronous (pub/sub) and synchronous (request/reply) communication with the same broker. The request/reply pattern enables calls between microservices without HTTP. -
Queue groups for load balancing
Several instances of the same service in a queue group share messages - each message is processed by a single member of the group. - Wildcards on subjects
orders.* matches one level, orders.> matches all levels. Powerful filtering without exchange configuration -
JetStream optional
Activate JetStream only if you need persistence. For ephemeral pub/sub (notifications, real-time metrics), basic NATS is lighter.
apiVersion: apps.cozystack.io/v1alpha1
kind: NATS
metadata:
name: example
spec:
replicas: 3
resourcesPreset: small
storageClass: replicated
external: false
jetstream:
enabled: true
size: 10Gi
users:
user1:
password: mypassword
config:
merge:
max_payload: 16MB
write_deadline: 2s
What you don't have to do anymore
Kafka, RabbitMQ and NATS are three different distributed systems, but they share the same self-hosted problem: each requires dedicated expertise to operate correctly in production. Sizing nodes, configuring quorum, testing failover, managing version upgrades without interrupting message flow represents engineering time that doesn't produce business value.
On Hikube, the Kubernetes operator absorbs this load for all three services. You declare what you want - number of nodes, topics or vhosts, resources - and the operator provisions, replicates and switches in the event of failure. Modifying the configuration is as simple as changing a value in a YAML file and applying it.
Automatic quorum and consensus
ZooKeeper for Kafka, Raft for RabbitMQ and NATS JetStream. Leader election mechanisms are configured and monitored without manual intervention.
Topics, vhosts and streams with the cluster
Partitions, retention, virtual hosts, JetStream streams declared in YAML in the same place. No separate initialization script to maintain.
Scaling without interruption
Modify the number of nodes in the manifest and apply. The operator adds rolling update instances without manual rebalancing or downtime.
Self-generated credentials
Passwords are created in a Kubernetes Secret at provisioning. Reference the Secret in your pods, no unencrypted keys in your manifests or Git repositories.
Which service for which need?
The three services don't compete with each other, they complement each other. Here are the concrete patterns in which each one comes into its own.
Application log pipeline
Ingestion of millions of log events from 50 microservices. 7-day retention, several independent consumers (Elasticsearch, ClickHouse, alerting). Each consumer reads from its own offset.
Event sourcing and audit trail
Each user action is published on a topic with cleanup.policy: compact. The current state is the sum of all events. The compact topic guarantees preservation of the last state per key.
Email processing queue
Commands trigger a message in an emails.pending queue. Workers read the queue, send the email, and ACK the message. If a worker drops out, the message is re-queued automatically.
Multi-destination event routing
A topic exchange routes orders.* events to the billing queue, orders.shipped events to the logistics queue, and # events to an audit queue. One publish, many destinations.
Inter-microservice communication
Service A calls service B via NATS request/reply rather than HTTP. No service discovery, no load balancer. NATS routes directly to an available subscriber in the queue group.
Telemetry IoT with JetStream
10,000 sensors publish metrics on sensors.>. JetStream stores 24 hours of data. Analysis services connect and replay history at startup. Useful after maintenance.
Event-driven, the foundation of modern architectures
Event-driven architectures have become the standard for modern distributed systems. Where synchronous APIs create fragile couplings, message brokers enable services to communicate without direct dependency. Each service produces or consumes events at its own pace.
Kafka structures pipelines of high-volume data - logs, metrics, business events - with long retention and event replay to simplify auditing and disaster recovery. RabbitMQ ensures reliable routing of critical tasks: each message is processed exactly once, with guaranteed delivery. NATS reduces friction between microservices thanks to lightweight communication, microsecond latency and no heavy infrastructure.
In the managed version, your teams adopt these patterns without starting from scratch on the infrastructure. Same technology, same SDKs, same tools, deployed and operated by Hikube.
Decoupling and application resilience
One service out of order doesn't drag down the others. Messages accumulate in the broker and are processed on resumption, without loss or manual intervention.
IoT and edge computing
NATS ingests millions of sensor events with a minimal memory footprint. JetStream ensures that data is not lost if a processing service restarts.
Data streaming and real-time analytics
Feed ClickHouse, Elasticsearch or your Grafana dashboards continuously from Kafka. The same topic can feed several independent consumers simultaneously.
Compatible with your stack
Kafka Connect, Confluent SDKs, pika, nats.go, nats.py. All existing clients work without modification. Point to the Kubernetes service, the rest is the same.
FAQ
Question about Managed Streaming & Messaging
Kafka or RabbitMQ, what's the best choice?
Kafka is made for high-volume streaming and long retention - messages remain available after consumption, and several consumers can read the same topic independently. It's the natural choice for data pipelines, event sourcing and real-time analytics.
RabbitMQ is made for task queues and complex routing - messages are consumed and discarded, with guaranteed acknowledgement. It's the natural choice for background processing, asynchronous workflows and systems where every message has to be processed exactly once.
When should you use NATS rather than Kafka or RabbitMQ?
NATS is the right choice when you need light, fast communication between microservices - without the complexity of a heavyweight broker. Its sub-millisecond latency and minimal memory footprint (<10 MB per instance) make it the best choice for edge architectures, IoT, and request/reply communications between services.
If you need long-lasting persistence and large-scale event replay, Kafka is more suitable. If you need complex routing with guaranteed ACK, RabbitMQ is more appropriate.
Why does ZooKeeper require an odd number of replicas?
Is NATS JetStream enabled by default?
Yes, JetStream is enabled by default on Hikube NATS clusters. Disable it only if you need a purely ephemeral pub/sub without persistence - you'll reduce the memory footprint and eliminate the need for a persistent volume. In production, keep JetStream activated to benefit from persistence, replay and durable consumer groups.
Please note: even with JetStream enabled, messages are only persisted if a stream is configured to capture the subjects concerned.
What's the difference between partitions and replicationFactor in Kafka?
Partitions define parallelism - more partitions allow more consumers to read in parallel. Each partition is an ordered sequence of messages on a broker.
The replicationFactor defines durability - each partition is copied to this number of brokers. If a broker goes down, its partitions are served by replicas. The replicationFactor cannot exceed the number of brokers.
Can I expose my cluster outside the Kubernetes cluster?
Yes, for Kafka and RabbitMQ via external: true, and for NATS via external: true. Kafka creates a LoadBalancer per broker, RabbitMQ exposes the AMQP (5672) and Management (15672) ports, NATS exposes the client port (4222).
External exposure makes the service accessible over the Internet - make sure you use strong passwords. Kafka has no default authentication on Hikube, so we strongly advise against exposing it without additional security configuration.