How to set offsets.retention.minutes?

Hi everyone,

I am trying to learn Kafka and wanted to test offsets.retention.minutes in effect.

I am using a compose file retrieved from raw.githubusercontent.com/confluentinc/cp-all-in-one/7.5.2-post/cp-all-in-one-kraft/docker-compose.yml

I added offstets.retention.minutes=2 to server.properties file and restarted the container but when I check it doesn’t work.

What is the correct way of setting that value?

Thanks in advance.

You’d set a Docker environment variable to do this:

    KAFKA_OFFSETS_RETENTION_MINUTES: 2

More here on configuring cp-kafka. For any Apache Kafka broker config, prefix it with KAFKA_, replace periods with underscores, and uppercase it.