Re: Builder Pattern for kafka-clients in 2.x ?

2018-07-13 Thread Matthias Wessendorf
Hi, Tommy! thanks for the feeback - I've reopened the PR adding the ctor overload. I've drafted a ProducerBuilder, which can be used like: final Producer producer = new ProducerBuilder() .partitionerClass(DefaultPartitioner.class)

Re: Builder Pattern for kafka-clients in 2.x ?

2018-07-05 Thread Thomas Becker
Personally, I like the idea of builders for the producer/consumer themselves, but I'm less enthusiastic about one for ProducerRecord. Mostly because I think the following is overly verbose/reads poorly: producer.send(ProducerRecord.builder() .topic("mytopic") .key("Key")

Builder Pattern for kafka-clients in 2.x ?

2018-07-04 Thread Matthias Wessendorf
Hi, I was filing KAFKA-7059 ([1]) and sent a PR adding a new ctor: -- public ProducerRecord(String topic, K key, V value, Iterable headers) --- One reasonable comment on the PR was instead of doing constructor overloading, why not working on a builder for the ProducerRecord class. I think this