Search code examples
spring-bootspring-kafka

Spring kafka transaction id is wrong at start?


I'm using spring kafka 2.2.2.RELEASE

Our broker has strict authorization verification.

Here is our client configuration :

  • spring.kafka.producer.transaction-id-prefix=test.
  • topic : topic
  • groupId: group

It should generate a transactional id : "test.group.topic0"

Problem:

When I start the application, KafkaMessageListenerContainer#onPartitionsAssigned is called and the transactional id used is "test0". It seems like in this case, the kafkaTemplate is not considered to be in a listenerContainer.

This is leading to an Unauthorized exception because this transactional id is refused by the broker

Question

Is it normal ?


Solution

  • Thanks; it's a bug; I opened an issue.