I am new to Kafka. I'd like to see example code that uses a Producer and 
handles connectivity errors to Kafka brokers and/or ZooKeeper.

I have seen some code that creates and tears down a Producer for each message 
that is sent, but this doesn't seem right to me. The same example code, queries 
ZooKeeper to ask if Kafka is running before creating the Producer. I don't know 
why this is done. What if ZooKeeper isn't up? Why not just try to make the 
connection and handle any errors that occur?

A nice, well written example, would clear up a lot of my questions.

Thanks,
C. Helck

**********************************************************************
This communication and all information contained in or attached to it 
(including, but not limited to market prices/levels and market commentary) (the 
“Information”) is for informational purposes only, is confidential, may be 
legally privileged and is the intellectual property of one of the companies of 
ICAP plc group (“ICAP”) or third parties. The Information is not, and should 
not be construed as, an offer, bid, recommendation or solicitation in relation 
to any financial instrument or investment or to participate in any particular 
trading strategy. The Information is not to be relied upon and is not 
warranted, including, but not limited, as to completeness, timeliness or 
accuracy and is subject to change without notice. All representations and 
warranties are expressly disclaimed. Access to the Information by anyone other 
than the intended recipient is unauthorised and any disclosure, copying or 
redistribution is prohibited. If you receive this message in error, please 
immediately delete all copies of it and notify the sender. For further 
information, please see ebs.com.
**********************************************************************
---------------------------------------------------------------------------------------
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---------------------------------------------------------------------------------------


Reply via email to