NIFI-16097 Added enable.idemotence Option in Publish Kafka Processor#11413
NIFI-16097 Added enable.idemotence Option in Publish Kafka Processor#11413loguylo wants to merge 1 commit into
Conversation
f5b9d83 to
da4743d
Compare
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for proposing this additional configuration option @loguylo. This looks like a straightforward addition on initial review, I noted one stylistic recommendation.
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks @loguylo, please review the integration test failures, which may require re-evaluating the default setting of the new property.
org.apache.nifi.processor.exception.ProcessException: Failed to create Kafka Producer
at org.apache.nifi.kafka.service.producer.Kafka3ProducerService.<init>(Kafka3ProducerService.java:61)
at org.apache.nifi.kafka.service.Kafka3ConnectionService.getProducerService(Kafka3ConnectionService.java:298)
at org.apache.nifi.kafka.service.Kafka3ConnectionServiceBaseIT.testProduceOneWithTransaction(Kafka3ConnectionServiceBaseIT.java:256)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: org.apache.kafka.common.config.ConfigException: Cannot set a transactional.id without also enabling idempotence.
at org.apache.kafka.clients.producer.ProducerConfig.postProcessAndValidateIdempotenceConfigs(ProducerConfig.java:635)
at org.apache.kafka.clients.producer.ProducerConfig.postProcessParsedConfig(ProducerConfig.java:574)
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:119)
at org.apache.kafka.common.config.AbstractConfig.<init>(AbstractConfig.java:136)
at org.apache.kafka.clients.producer.ProducerConfig.<init>(ProducerConfig.java:692)
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:313)
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:340)
at org.apache.nifi.kafka.service.producer.Kafka3ProducerService.<init>(Kafka3ProducerService.java:59)
... 5 more
2026-07-10 14:14:43:611 [kafka-coordinator-heartbeat-thread | Kafka3ConnectionService] INFO org.apache.kafka.clients.NetworkClient - [Consumer clientId=consumer-Kafka3ConnectionService-10, groupId=Kafka3ConnectionService] Node 1 disconnected.
2026-07-10 14:14:43:612 [kafka-coordinator-heartbeat-thread | Kafka3ConnectionService] WARN org.apache.kafka.clients.NetworkClient - [Consumer clientId=consumer-Kafka3ConnectionService-10, groupId=Kafka3ConnectionService] Connection to node 1 (localhost/127.0.0.1:32925) could not be established. Node may not be available.
Error: Errors:
Error: Kafka3ConnectionServiceBaseIT.testProduceOneWithTransaction:256 » Process Failed to create Kafka Producer
Error: Kafka3ConnectionServiceSSLIT>Kafka3ConnectionServiceBaseIT.testProduceOneWithTransaction:256 » Process Failed to create Kafka Producer
Error: Kafka3ConnectionServiceSaslPlaintextIT>Kafka3ConnectionServiceBaseIT.testProduceOneWithTransaction:256 » Process Failed to create Kafka Producer
|
Thanks @exceptionfactory, After further research, it seems like the correct behavior is shown here. Based on the documentation, the It means that The current implementation simply asks the user to disable transactions if acks!=all. I believe the structure should look like that - ENABLE_IDEMPOTENCE = PropertyDescriptor.Builder()
.dependsOn(DELIVERY_GUARANTEE, DeliveryGuarantee.DELIVERY_REPLICATED);
TRANSACTIONS_ENABLED = new PropertyDescriptor.Builder()
.dependsOn(ENABLE_IDEMPOTENCE, "true");
TRANSACTIONAL_ID_PREFIX = new PropertyDescriptor.Builder()
.dependsOn(TRANSACTIONS_ENABLED, "true");This also means that the deafult value of What do you think? |
|
Forgot to mention, the default values of these properties should also change, so the default values of |
|
Thanks for evaluating the options @loguylo. The proposal to set |
Summary
NIFI-16097
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation