All Products
Search
Document Center

ApsaraMQ for Kafka:Modify message configurations

Last Updated:Aug 26, 2026

You can adjust the message retention period, maximum message size, consumer offset retention period, and SSL certificate key size based on your business requirements.

ApsaraMQ for Kafka lets you adjust message configurations from the console to match your business requirements. Because the change triggers a rolling restart of your instance, review the change impact and complete the prerequisites before you begin.

Change impact

Modifying message configurations affects a running instance. Review the following impact before you begin:

  • Service interruption — The change triggers a rolling restart of the cluster, which may cause a short-term service interruption.

  • Client reconnection — If a client does not implement automatic reconnection, it cannot recover the connection after it is disconnected.

Note

The time required to modify message configurations depends on the instance specification. For instances of the alikafka.hr.30xlarge or alikafka.hw.30xlarge specification and lower, the change takes about 30 minutes. For instances of the alikafka.hr.60xlarge or alikafka.hw.60xlarge specification and higher, the change takes more than 1 hour. In general, the larger the instance specification, the longer the change takes.

Parameters

The following table describes the message configurations that you can modify.

ParameterDescription
Message Retention PeriodThe maximum period for which a message is retained when the disk space is sufficient. If the disk space is insufficient, that is, if the disk usage reaches 85%, earlier messages are deleted ahead of schedule to ensure service availability. Default value: 72 hours. Valid values: 24 to 480 hours.
Maximum Message SizeThe maximum size of a message that ApsaraMQ for Kafka can send or receive. The maximum message size is capped at 10 MB. This limit applies to both standard instances and professional instances.
Consumer Offset Retention Period

The maximum retention period of a consumer offset. The period is counted from the time when the consumer offset is committed. The system deletes consumer offsets that exceed the period. Each time a consumer offset is committed to a topic partition, the retention period of the consumer offset is reset and recounted from 0. The default retention period is 7 days, which is 10,080 minutes. Valid values: 1,440 to 43,200 minutes.

Note

As long as a consumer group contains at least one active consumer thread, the consumer offsets of the consumer group are not deleted even if they exceed the Consumer Offset Retention Period value. For more information, see Why are expired consumer offsets retained?.

SSL Certificate Key Size (Bits)The key size of the SSL certificate that is used when Internet access is enabled for the instance. You can upgrade the key size from 1,024 bits to 4,096 bits. Downgrading the key size from 4,096 bits to 1,024 bits is not recommended.

Prerequisites

Complete the following prerequisites for each parameter that you plan to modify:

  • Maximum message size — Before you increase the maximum message size, make sure that the new value matches the corresponding configurations of your producer and consumer clients.

  • SSL certificate key size — Before you upgrade the key size on the instance, first upgrade the key size of the client certificate and then restart the client. For more information, see Update the SSL certificate algorithm.

Procedure

  1. Log on to the ApsaraMQ for Kafka console. In the Resource Distribution section of the Overview page, select the region where the ApsaraMQ for Kafka instance that you want to manage resides.

  2. On the Instances page, click the name of the instance that you want to manage.

  3. On the Instance Details page, in the Configuration Information section, click Edit to the right of the parameter that you want to modify.

  4. In the Risks of Configuration Modification dialog box, read and confirm the risks, and then click OK.

Verify the result

To track the progress of the change, see View task execution records. After the change is complete, check whether your applications run as expected.