Does anybody know if
kafka.javaapi.producer.Producer
can be reused among several method invocations (e.g. several send(...)) or it should be closed each time?
Does anybody know if
kafka.javaapi.producer.Producer
can be reused among several method invocations (e.g. several send(...)) or it should be closed each time?
Yes, it can surely be reused. Producer
creation is pretty slow operation because it requires establishing connection to all partitions (and probably zookeeper). So, Producers should be reused when possible.