-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Remove SslBundles from KafkaProperties as it is no longer used #45727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sehwan <[email protected]>
I’d like to ask for guidance regarding the proper direction for this change. Since Option 1 – Minimal change (currently applied in PR): public Map<String, Object> buildConsumerProperties() {
Map<String, Object> properties = buildCommonProperties(null);
properties.putAll(this.consumer.buildProperties(null));
return properties;
} This keeps the current method signature of buildProperties(SslBundles) and simply passes null, minimizing code changes. Option 2 – Cleanup approach: public Map<String, Object> buildConsumerProperties() {
Map<String, Object> properties = buildCommonProperties(null);
properties.putAll(this.consumer.buildProperties());
return properties;
} public static class Consumer {
private final Ssl ssl = new Ssl();
...
public Map<String, Object> buildProperties() {
Properties properties = new Properties();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
map.from(this::getAutoCommitInterval)
.asInt(Duration::toMillis)
...
.to(properties.in(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG));
return properties.with(this.ssl, this.security, this.properties, null);
}
} This removes the now-unnecessary parameter entirely and results in a cleaner method. Functionally, both options appear to be equivalent. I'd love to hear your thoughts. Thank you! |
Thanks for noticing this, @Torres-09. I think we should go for the second option. |
Thank you for the feedback! I’ll proceed to remove all remaining references to SslBundles from KafkaProperties, as well as update the related classes and tests accordingly. I’ll revise the PR to reflect these changes. |
Signed-off-by: Sehwan <[email protected]>
@@ -128,42 +114,6 @@ void sslPropertiesWhenTrustStoreLocationAndCertificatesSetShouldThrowException() | |||
.isThrownBy(properties::buildConsumerProperties); | |||
} | |||
|
|||
@Test | |||
void sslPropertiesWhenKeyStoreLocationAndBundleSetShouldThrowException() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be kept but should call .isThrownBy(properties::buildConsumerProperties);
.
} | ||
|
||
@Test | ||
void sslPropertiesWhenKeyStoreKeyAndBundleSetShouldThrowException() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be kept but should call .isThrownBy(properties::buildConsumerProperties);
.
} | ||
|
||
@Test | ||
void sslPropertiesWhenTrustStoreLocationAndBundleSetShouldThrowException() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be kept but should call .isThrownBy(properties::buildConsumerProperties);
.
} | ||
|
||
@Test | ||
void sslPropertiesWhenTrustStoreCertificatesAndBundleSetShouldThrowException() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should be kept but should call .isThrownBy(properties::buildConsumerProperties);
.
Signed-off-by: Sehwan Lim <[email protected]>
@wilkinsona 👋 Thanks for the review. I've restored the four All tests pass locally. Let me know if anything else needs to be adjusted! |
This PR removes the deprecated
buildConsumerProperties(SslBundles)
method from theKafkaProperties
.The removed test has been restored and updated to reflect the new logic. All tests and builds pass locally.
assertThatExceptionOfType(MutuallyExclusiveConfigurationPropertiesException.class).isThrownBy(properties::buildConsumerProperties);
gh-45722