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
be lost (up to the ack setting you've specified for your producer).

On Wed, Jan 27, 2016 at 9:45 AM, Joe San <codeintheo...@gmail.com> wrote:

> 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
> the KafkaProducer object?
>



-- 
Thanks,
Ewen

Reply via email to