Hello,

I've a question regarding the design of the new Producer API.

As per the design (KafkaProducer<K,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 per application and share it among the all the threads
for best performance?

One way to create only single producer would be to use byte[] as key/value
type and handle the serialization at the client itself, rather than the
producer, similar to the example in javadocs. But wouldn't this defeat the
purpose of using generics in the producer?

Specific to our use case, we have multiple types of messages, where each
message type can have multiple custom serializers. And, a message can be
pushed into mulitple topics with different serialization.


-- 
Best Regards,

Mohit Gupta

Reply via email to