> If you create a new `ProducerRecord` you would not pass in a `Headers`
> object but a `Iterable<Header>`?
> 
> And for `ConsumerRecord` you just get a `Headers` object back and don't
> need to worry about the concrete implementation?

You are right. I'd give a bad case :(

For another reason, could we avoid using a mutable object to be the response 
type? ConsumerRecord and ProducerRecord have a good chance to be immutable if 
we can remove setters from Headers.  

On 2020/08/18 20:42:59, "Matthias J. Sax" <mj...@apache.org> wrote: 
> Thanks for the KIP. However, I am not sure for what use-case you would
> need to implement the `Headers` interface?
> 
> If you create a new `ProducerRecord` you would not pass in a `Headers`
> object but a `Iterable<Header>`?
> 
> And for `ConsumerRecord` you just get a `Headers` object back and don't
> need to worry about the concrete implementation?
> 
> 
> -Matthias
> 
> 
> On 8/18/20 3:39 AM, Chia-Ping Tsai wrote:
> > Hi everyone,
> > 
> > I would like to start a discussion on KIP-658: 
> > https://cwiki.apache.org/confluence/x/-DJ4CQ
> > 
> > KIP-658 plans to deprecate all setters of Headers and provide default 
> > implementation. The benefit of this KIP are shown below.
> > 
> > 1. Users don't need to implement those setters which are not used by kafka.
> > 2. open a room to refactor Headers in next major (for example, a pojo 
> > Headers)
> > 
> > feedback is welcome!!!
> > 
> > ----
> > chia-ping
> > 
> 
> 

Reply via email to