Kafka Producer producer.send very slow
<p>I'm trying to write a simple Avro message producer for Kafka, using Scala.</p>

<p>The problem I am having is that the sending is very slow.</p>

<p>I am doing this:</p>

<pre><code>val message: GenericRecord = getRandomMessage()
val serializedMessage: Array[Byte] = serializeMessage(message)

val queueMessage = new ProducerRecord[String, Array[Byte]](topic, message.get("id").toString, serializedMessage)
producer.send(queueMessage)
println("Sent Message: "+ message)
</code></pre>

<p>Both when deploying to my cluster, as well as when running from my IDE it is extremely slow to send the messages.</p>

<p>From what I read the message should be asynchronous and quicker than this.</p>

<p>Is there something obvious that I'm missing?</p>

<p>Thanks!</p>