Apache kafka sending java object failed
<p>I have this object</p>

<pre><code>       HashMap message = new HashMap();
       message.put("x", "xxxxx");
       message.put("y", "yyyyy");
       message.put("z", 100);

       ProducerRecord producerRecord = new ProducerRecord(topic, message);
       producer.send(producerRecord); 
</code></pre>

<p>I am getting </p>

<blockquote>
  <p>Exception in thread "main" org.apache.kafka.common.errors.SerializationException: Can't convert value of class java.util.HashMap to class org.apache.kafka.common.serialization.StringSerializer specified in value.serializer</p>
</blockquote>