Closed rycee closed 4 years ago
When configured only at the property level, my understanding is that TRANSACTION_ID_CONFIG
is useless without else setting ENABLE_IDEMPOTENCE_CONFIG
to true
. From the docs for the former:
Note that enable.idempotence must be enabled if a TransactionalId is configured.
As its name suggests, the transaction-id-prefix
configuration property was added to map to the transaction ID prefix of DefaultKafkaProducerFactory
. The producer factory automatically enables idempotent behaviour when a transaction ID prefix is set.
Like all of Boot's own @ConfigurationProperties
classes, we also consider KafkaProperties
to be internal:
Similar to auto-configuration classes,
@ConfigurationProperties
classes available in Spring Boot are for internal use only. The properties that map to the class, which are configured via properties files, YAML files, environment variables etc., are public API but the content of the class itself is not meant to be used directly.
As such, you shouldn't be using it for your own purposes and should use your own @ConfigurationProperties
class instead.
We can revisit the current situation as part of possibly adding auto-configure for Spring for Apache Kafka's reactive support. We also have another request, that is somewhat related, to provide auto-configuration for Reactor Kafka directly rather than Spring for Apache Kafka's wrapper.
Given that Reactor Kafka isn't a high priority for the Reactor team at the moment, we don't want to drive people towards it or Spring for Apache Kafka's features that are built on top of it. We can reconsider in the future if the situation changes.
To produce a
ReactiveKafkaProducerTemplate
I have to explicitly include theProducerConfig.TRANSACTIONAL_ID_CONFIG
property as per the following exampleI would have expected this property to be included by default when calling
properties.buildProducerProperties()
makingwork.
The transactional ID prefix property was added in #11076.