Middle
When are messages deleted in Kafka and RabbitMQ?
sobes.tech AI
Answer from AI
In Kafka, messages are deleted based on the retention policy, which is set by retention parameters. Messages are stored in topics for a certain period (e.g., 7 days) or until the maximum log size is reached, after which old messages are automatically deleted. Deletion does not depend on whether the consumer has read the message.
In RabbitMQ, messages are deleted after they have been acknowledged by the consumer. If a message is delivered and acknowledged, it is removed from the queue. Messages can also be deleted after the TTL (time-to-live) expires or when the queue overflows, if the corresponding policies are configured.