Re: New Producer API Design

2015-05-14 Thread Mohit Gupta
Thanks guys, I got the point. We ended up handling the ser/de in custom wrappers over the generic byte[],byte[] producer to ensure only single producer for the application and neither lose the type safety. On Wed, May 13, 2015 at 11:31 PM, Guozhang Wang wangg...@gmail.com wrote: Hello

New Producer API Design

2015-05-13 Thread Mohit Gupta
Hello, I've a question regarding the design of the new Producer API. As per the design (KafkaProducerK,V), it seems that a separate producer is required for every combination of key and value type. Where as, in documentation ( and elsewhere ) it's recommended to create a single producer instance

Re: New Producer API Design

2015-05-13 Thread Ewen Cheslack-Postava
You can of course use KafkaProducerObject, Object to get a producer interface that can accept a variety of types. For example, if you have an Avro serializer that accepts both primitive types (e.g. String, integer types) and complex types (e.g. records, arrays, maps), Object is the only type you

Re: New Producer API Design

2015-05-13 Thread Guozhang Wang
Hello Mohit, When we originally design the new producer API we removed the serializer / deserializer from the old producer and made it generic as accepting only messagebyte[], byte[], but we later concluded it would still be more beneficial to add the serde back into the producer API. And as you