Issue
You would like to configure Apache Kafka on Heroku to have indefinite retention of messages in a topic.
Resolution
It is possible to configure a topic in Apache Kafka on Heroku to have indefinite retention of messages, a long as the following conditions are met:
- You are using a single-tenant cluster (https://devcenter.heroku.com/articles/kafka-on-heroku#plans-and-configurations), rather than a multi-tenant cluster (our
basic
plan: https://devcenter.heroku.com/articles/multi-tenant-kafka-on-heroku) - Time-based retention is disabled for the topic (
heroku kafka:topics:retention-time my-topic disable
) - Compaction is enabled for the topic (
heroku kafka:topics:compaction enable
) - Total size of all topics does not exceed the storage capacity for your plan.