Configuration properties for MSK Serverless clusters - Amazon Managed Streaming for Apache Kafka
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Configuration properties for MSK Serverless clusters

Amazon MSK sets broker configuration properties for serverless clusters. You can't change these broker configuration property settings. However, you can set or modify the following topic-level configuration properties. All other topic-level configuration properties are not configurable.

Configuration property Default Editable Maximum allowed value
cleanup.policy Delete Yes, but only at topic creation time

compression.type

Producer Yes

max.message.bytes

1048588 Yes 8388608 (8MiB)
message.timestamp.difference.max.ms long.max Yes

message.timestamp.type

CreateTime Yes

retention.bytes

250 GiB Yes Unlimited; set it to -1 for unlimited retention

retention.ms

7 days Yes Unlimited; set it to -1 for unlimited retention

To set or modify these topic-level configuration properties, you can use Apache Kafka command line tools. See 3.2 Topic-level Configs in the official Apache Kafka documentation for more information and examples of how to set them.

When using the Apache Kafka command line tools with Amazon MSK Serverless, make sure you completed steps 1-4 in the To set up Apache Kafka client tools on the client machine section of the Amazon MSK Serverless Getting Started documentation. Additionally, you must include the --command-config client.properties parameter in your commands.

For example, the following command can be used to modify the retention.bytes topic configuration property to set unlimited retention:

<path-to-your-kafka-client-installation>/bin/kafka-configs.sh —bootstrap-server <bootstrap_server_string> —command-config client.properties --entity-type topics --entity-name <topic_name> --alter --add-config retention.bytes=-1

In this example, replace <bootstrap server string> with the bootstrap server endpoint for your Amazon MSK Serverless cluster, and <topic_name> with the name of the topic you want to modify.

The --command-config client.properties parameter ensures that the Kafka command line tool uses the appropriate configuration settings to communicate with your Amazon MSK Serverless cluster.