Why is the "Cluster authorization failed" error reported during message sending after I enable the idempotence feature?

更新时间:
复制 MD 格式

Problem description

After I enable the idempotence feature, the Cluster authorization failed error message is returned to the client when I send messages.

Causes

  • You use a topic that uses cloud storage. Such topics do not support the idempotence feature.

  • The IDEMPOTENT_WRITE permission on the cluster is not granted to the message sender. If you use a topic that uses local storage and enable the ACL feature, the ApsaraMQ for Kafka broker automatically determines whether the message sender has the IDEMPOTENT_WRITE permission on the cluster. If the message sender does not have the permission, the message fails to be sent.

Solutions

  1. Cloud storage topics for reserved instances do not support the idempotence feature. Disable the feature by setting enable.idempotence=false on the producer.

    Note

    The idempotence feature is automatically enabled for an ApsaraMQ for Kafka client whose version is 3.0 or later. The enable.idempotence parameter is automatically set to true.

  2. Grant the required ACL permissions for the cluster. On the SASL permission management page in the console, use the Add Permission dialog box to configure the settings: specify the user, set Resource Type to Cluster, set Matching Method to Exact Match, and select IDEMPOTENT_WRITE for Operation Type. For more information, see Use ACL for access control.