How to create topics in apache kafka?
<p>What is the bestway to create topics in kafka?</p>

<ul>
<li>How many replicas/partitions to be defined when we create topics?</li>
</ul>

<p>In the new producer API, when i try to publish a message to a non existing topic , it first time fails and then successfully publishing.</p>

<ul>
<li>I would like to know, the relationships between replica, partitions and the number of cluster nodes.</li>
<li>Do we need to create topic prior to publish messages?</li>
</ul>