Kafka 在 spring 上流式传输,恰好一次 ACL 出现问题:TransactionalIdAuthorizationException
Kafka streams on spring, trouble with exactly once ACL: TransactionalIdAuthorizationException
我在从 springboot kafka-streams 应用程序连接到 Confluent cloud 上的主题时遇到问题,连接失败并显示单个错误行
org.apache.kafka.common.errors.TransactionalIdAuthorizationException: Transactional Id authorization failed.
我认为这是因为该主题被配置为允许具有指定交易 ID (https://docs.confluent.io/current/kafka/authorization.html#enabling-authorization-for-idempotent-and-transactional-apis). My service being a streaming application, generates a transactional-id in each StreamThread (create producer method in https://github.com/apache/kafka/blob/2.4.1/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java) 的交易,该交易 ID 被定义为 applicationId + "-" + taskId
,并且这与主题 ACL 上定义的不匹配.
这是否正确,如果正确,是否有解决方法?
您将需要通过仅指定前缀来使用通配符 ACL,即 <application.id>-
用于相应的 ACL,使用 --resource-pattern-type prefixed
比照。 https://docs.confluent.io/current/streams/developer-guide/security.html
我在从 springboot kafka-streams 应用程序连接到 Confluent cloud 上的主题时遇到问题,连接失败并显示单个错误行
org.apache.kafka.common.errors.TransactionalIdAuthorizationException: Transactional Id authorization failed.
我认为这是因为该主题被配置为允许具有指定交易 ID (https://docs.confluent.io/current/kafka/authorization.html#enabling-authorization-for-idempotent-and-transactional-apis). My service being a streaming application, generates a transactional-id in each StreamThread (create producer method in https://github.com/apache/kafka/blob/2.4.1/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java) 的交易,该交易 ID 被定义为 applicationId + "-" + taskId
,并且这与主题 ACL 上定义的不匹配.
这是否正确,如果正确,是否有解决方法?
您将需要通过仅指定前缀来使用通配符 ACL,即 <application.id>-
用于相应的 ACL,使用 --resource-pattern-type prefixed
比照。 https://docs.confluent.io/current/streams/developer-guide/security.html