Skip to content
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

GH-2762: Fix Topic Check with Consumer Overrides #2763

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

garyrussell
Copy link
Contributor

Resolves #2762

When checking for missing topics, the admin was created with the raw consumer factory properties and did not apply any overriding consumer properties in the ContainerProperties.

Apply the overrides before creating the admin.

Pull up a method that merges default properties (if any) because we have to iterate over the hash table because the user might have used put() instead of setProperty() to set properties.

cherry-pick to 2.9.x

Resolves spring-projects#2762

When checking for missing topics, the admin was created with the raw
consumer factory properties and did not apply any overriding consumer
properties in the `ContainerProperties`.

Apply the overrides before creating the admin.

Pull up a method that merges default properties (if any) because we
have to iterate over the hash table because the user might have used
`put()` instead of `setProperty()` to set properties.

**cherry-pick to 2.9.x**
*
*/
@EmbeddedKafka(topics = "mtccac")
public class MissingTopicCheckOverrideAdminConfig {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intentional do not use a *Tests suffix?

*
*/
@EmbeddedKafka(topics = "mtccac")
public class MissingTopicCheckOverrideAdminConfig {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 /home/runner/work/spring-kafka/spring-kafka/spring-kafka/src/test/java/org/springframework/kafka/listener/MissingTopicCheckOverrideAdminConfigTests.java:46: error: class MissingTopicCheckOverrideAdminConfig is public, should be declared in a file named MissingTopicCheckOverrideAdminConfig.java
public class MissingTopicCheckOverrideAdminConfig {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird; it is correct locally.

@artembilan artembilan merged commit 08e76d3 into spring-projects:main Aug 3, 2023
1 check passed
@artembilan
Copy link
Member

... and cherry-picked to 2.9.x

@garyrussell garyrussell deleted the GH-2762 branch August 4, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AdminClient doesn't use configured properties while starting a container listener
2 participants