Axon kafka: Transactional Id authorization failed


I using in my application axon 4.4.2 with extension kafka 4.0-RC3, and i have the below configuration in the producer service

    default-topic: dev_xxxxx
    transaction.state.log.replication.factor: 3
    transaction.state.log.min.isr: 3
      security.protocol: SASL_SSL kafka
      sasl.jaas.config: required doNotPrompt=true useKeyTab=true storeKey=true keyTab="xxxxx.keytab" principal="xxxxx" client=true debug=true serviceName="kafka";
      confirmation-mode: none
      transaction-id-prefix: xx
      - xxxxx:1111
      - xxxxx:1111
      - xxxxx:1111
      retries: 5

with this config i have this error

org.apache.kafka.common.errors.TransactionalIdAuthorizationException: Transactional Id authorization failed
2021-03-04 21:40:18.867 | [EventProcessor[org.axonframework.extensions.kafka.eventhandling.producer]-0] | ERROR |
o.a.e.LoggingErrorHandler | EventListener [KafkaEventPublisher] failed to handle event [749c3757-0317-4c59-a059-b712f8ded681] (AssignedEvent). Continuing processing with next listener

1 Like

Somewhat late to the party, but I hope to provide some guidance nonetheless.

As your exception shows, the problem arises because the transactional ID cannot be authorized.
Axon’s Kafka extension, however, does nothing specific with transaction id authorization at all.

What Axon’s Kafka Extension does with the security properties you’ve set is pass them along to construct a org.apache.kafka.clients.producer.Producer with it for you. So, in essence, it’s a gateway to simplify the construction of these components, something which you’d otherwise have to do yourself.

Given that’s the case, I need to apologize but share that I do not feel that this is an Axon-specific issue. Have you tried Kafka-specific user boards already? If so, and if you have an answer, it might be helpful to link it here for other users of the Kafka extension.