Axon kafka: Transactional Id authorization failed

Hello,

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

axon:
  kafka:
    default-topic: dev_xxxxx
    transaction.state.log.replication.factor: 3
    transaction.state.log.min.isr: 3
    properties:
      security.protocol: SASL_SSL
      sasl.kerberos.service.name: kafka
      sasl.jaas.config: com.sun.security.auth.module.Krb5LoginModule required doNotPrompt=true useKeyTab=true storeKey=true keyTab="xxxxx.keytab" principal="xxxxx" client=true debug=true serviceName="kafka";
    publisher:
      confirmation-mode: none
    producer:
      transaction-id-prefix: xx
      bootstrap-servers:
      - 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.