MINOR: align the constructor of KafkaConsumer to KafkaProducer#8605
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
this constructor is used by KafkaProducerTest only. I keep this method to minimize this PR
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the PR. Even though it removes some duplication, it adds some duplication that the previous approach avoided. To me, it's the approach proposed in this PR is more error prone.
There was a problem hiding this comment.
The previous approach was intended to avoid having this logic in many places.
There was a problem hiding this comment.
Thanks for reviews!
Do you mean that previous approach tried to avoid ‘’’addSerializerToConfig’’’? If so, should we do it for KafkaConsumer?
There was a problem hiding this comment.
Yeah, it's a bit error prone to have that logic in every constructor. We could move the propsToMap method to a utility class and use it on the consumer too.
c45abb9 to
af489fd
Compare
There was a problem hiding this comment.
the access modifier is changed from private to public as
- KafkaProducer has a same but public constructor
- the previous constructor (ConsumerConfig, ...) is useless
af489fd to
a43dfcf
Compare
a43dfcf to
e5b0086
Compare
|
@ijuma please note that this diff has changed fundamentally since you reviewed it, and it now modifies KafkaConsumer and not KafkaProducer. I would like to endorse this PR. Funnily enough I came to very similar conclusions when I worked on the same code yesterday and raised #8707 without any knowledge that this one existed. |
|
Please note that |
|
@nresare This "coincidence" is more favorite than "approved" :) |
|
@chia7712 did you get around to update the PR with a variant that removes the no-longer-used |
e5b0086 to
2cac7c3
Compare
There was a problem hiding this comment.
This test is similar to ConsumerConfigTest
ijuma
left a comment
There was a problem hiding this comment.
Thanks for the updates. A few comments below.
147d89c to
797f864
Compare
ijuma
left a comment
There was a problem hiding this comment.
Changes look good, just one comment below.
There was a problem hiding this comment.
Should we assert a string valued parameter too?
797f864 to
e51e19a
Compare
This PR includes following changes.
1. remove KafkaProducer#propsToMap2. align the constructor of KafkaProducer and KafkaConsumerCommitter Checklist (excluded from commit message)