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_WRITEpermission 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
-
Cloud storage topics for reserved instances do not support the idempotence feature. Disable the feature by setting
enable.idempotence=falseon the producer.NoteThe idempotence feature is automatically enabled for an ApsaraMQ for Kafka client whose version is 3.0 or later. The
enable.idempotenceparameter is automatically set to true. -
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.