title: How do I make kafka producer generate events in parallel?
body: <p>So, this is the code that I have, do I need to add something to properties?</p>
  
  <p>At first I thought this had to do with partitioning, but it turns out that there's a way to make kafka producer use more threads. </p>
  
  <p>Can someone explain how I can do this?</p>
  
  <pre><code>val props = new Properties()
  props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, url)
  props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer")
  props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringSerializer")
  props.put(ProducerConfig.PARTITIONER_CLASS_CONFIG, "IdPartitioner")
  var kafkaProducer = new KafkaProducer[String, String](props)
  </code></pre>