RabbitMQ pushes messages to consumers from queues, while Kafka stores messages in logs and consumers pull messages at their own pace.
Kafka retains messages for a configured time or size limit even after consumers read them, enabling replay. RabbitMQ deletes messages once consumers acknowledge them.
rabbitmqctl set_policy ha-all ".*" '{"ha-mode":"all"}'
The command uses the regex pattern ".*" to match all queues and sets ha-mode to "all" to mirror queues across all nodes.
Consumer lag happens when consumers cannot keep up with the rate of incoming messages, causing them to fall behind the latest offset.
Kafka is designed for high throughput and durable log storage, enabling consumers to replay messages. RabbitMQ deletes messages after consumption and is not optimized for replay.
