NIFI-14630 Corrected usage of KafkaClientComponent interface#9993
NIFI-14630 Corrected usage of KafkaClientComponent interface#9993exceptionfactory merged 2 commits intoapache:mainfrom
Conversation
mark-bathori
left a comment
There was a problem hiding this comment.
Thanks @turcsanyip for these fixes and corrections. The changes looks good.
LGTM +1
| .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR) | ||
| .expressionLanguageSupported(ExpressionLanguageScope.ENVIRONMENT) | ||
| .defaultValue("localhost:9092") |
There was a problem hiding this comment.
Any reason for not keeping this validator and the default value?
There was a problem hiding this comment.
Thanks for flagging this!
In general, I did not want to change the behavior of the properties in order to eliminate compatibility issues at all. So I took the property definitions from Kafka3ConnectionService because those were used effectively.
On the other hand, it makes sense to add HOSTNAME_PORT_LIST_VALIDATOR because the existing Bootstrap Servers property values must be following this format already. Otherwise the property is unusable. So this seems a minimal risk change and therefore I'm leaning toward adding the validator.
Regarding localhost:9092 default value: The "localhost" values are typically used during development only and they must be changed in real life use cases almost all the time. Personally, I don't prefer "developer defaults" exposed in prod apps (even if it is handy for devs). However, I see that we use "localhost" defaults in some places so if you think it is kind of a convention in NiFi, I can add it.
So I'm +1 for the validator and rather -1 for the default value. Please share what you think based on the background info provided above and I will change the code accordingly.
There was a problem hiding this comment.
Yep, fair enough, sounds good to me, thanks @turcsanyip
There was a problem hiding this comment.
I agree with removing the localhost:9092 default value, and instead having it null is best, thanks @turcsanyip and @pvillard31.
pvillard31
left a comment
There was a problem hiding this comment.
Thanks @turcsanyip - I had another look at the changes and I'm a +1
@exceptionfactory - feel free to merge if you're a +1 as well or I can do it
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks @turcsanyip, and thanks for the review @pvillard31, I concur with the changes. +1 merging
The PR removes
KafkaPublishComponent/KafkaClientComponentinterface implementation fromPublishKafka. The single property that was used fromKafkaPublishComponenthas been moved to the processor (as other publisher specific properties).Kafka3ConnectionServicenow implementsKafkaClientComponentin order for the properties be defined in a single location. The properties in the interface have been updated from the controller service (they were used from the service effectively, the interface just provided property names for the shared code).Summary
NIFI-14630
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation