Shutting down Producer

2016-01-27 Thread Joe San
Is it mandatory to properly shutdown a Kafka producer? I have a single producer instance in my web application. When we deploy / restart this web application, we terminate the JVM process and start the web application all over again afresh. So why should I worry about calling the close method on th

Re: Shutting down Producer

2016-01-27 Thread Ewen Cheslack-Postava
If you don't shut it down properly and there are outstanding requests (e.g. if you call producer.send() and don't call get() on the returned future), then you could potentially lose data. Calling producer.close() flushes all the data before returning, so shutting down properly ensures no data will