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

Consumer's properties are also used for a producer to retry #29

Closed
ta7uw opened this issue Mar 29, 2020 · 2 comments · Fixed by #30
Closed

Consumer's properties are also used for a producer to retry #29

ta7uw opened this issue Mar 29, 2020 · 2 comments · Fixed by #30

Comments

@ta7uw
Copy link
Member

ta7uw commented Mar 29, 2020

The following type of warning occurs many times when using the retry mechanism of decaton.

The configuration 'group.id' was supplied but isn't a known config.

This warning occurs when a producer is given unused properties.

https://github.com/apache/kafka/blob/779f1444f128e9d77486243cb94d7efcdea26f52/clients/src/main/java/org/apache/kafka/common/config/AbstractConfig.java#L353-L355

I found that the following code causes this warning.

Properties producerConfig = Optional.ofNullable(retryConfig.producerConfig())
.orElse(consumerConfig);

Properties for a consumer are also used for properties for a retry producer.
I think this behavior is designed to set bootstrap.servers and so on without settings for retry.
But, more consumer's properties there are, the more warnings may occur.
It might be a good idea to filter consumer's properties in order to set the properties to a retry producer without warnings.

@kawamuray
Copy link
Member

kawamuray commented Mar 30, 2020

Thanks for reporting :)

It might be a good idea to filter consumer's properties in order to set the properties to a retry producer without warnings.

Right, we were aware of this occurrences of warn logs but it's something better to not to have.
I think suppressing it is possible just by taking intersection between producerConfig and kafka-client's ProducerConfig.configNames() -> Set<String>.

Would you be interested in sending a PR for that?

@ta7uw
Copy link
Member Author

ta7uw commented Mar 30, 2020

Would you be interested in sending a PR for that?

Yes, I will create a PR.

ta7uw added a commit to ta7uw/decaton that referenced this issue Mar 30, 2020
ta7uw added a commit to ta7uw/decaton that referenced this issue Mar 31, 2020
kawamuray pushed a commit that referenced this issue Apr 1, 2020
* Filter consumerConfig to use it as a producerConfig #29

* Add #producerConfigSupplier to SubscriptionBuilder to extract producer config #29
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 a pull request may close this issue.

2 participants