title: Serialize JSON String to AVRO Apache Beam KafkaIO
body: <p>I have a JSON String that needs to be serialized to AVRO format so that I can publish that to a Kafka topic that has an Avro schema with schema validation on it. Below is what I have tried so far but it gives a validation error.</p>
  <pre><code>@Override     
  public PDone expand(PCollection&lt;Product&gt; input) {
      return input.apply(&quot;Write to Kafka Topic&quot;, KafkaIO.&lt;Void, String&gt;write().
                  withBootstrapServers(kafkaUrl)
                  .withTopic(kafkaTopic)
  //                .withKeySerializer(StringSerializer.class)
                  .withValueSerializer(StringSerializer.class)
  </code></pre>
  <p>The error I am getting is</p>
  <pre><code>send failed : 'This record has failed the validation on broker and hence be rejected.'
  </code></pre>