title: Using multiple deserializers for a kafka consumer
body: <p>I am new to kafka and even serialization. until now I was required to handle kafka events of json format serialized using simple code. but now extra events are being added using Avro encoder. so now I want this single consumer to use StringDeserialzer if in json and for Avro its respective deserializer. but how can i map 2 Deserializer in the same properties file?</p>
  
  <pre><code>private Properties getProps(){
      Properties props = new Properties();
      props.put("group.id", env.getProperty("group.id"));
      props.put("enable.auto.commit", env.getProperty("enable.auto.commit"));
      props.put("key.deserializer", env.getProperty("key.deserializer"));
      props.put("value.deserializer", env.getProperty("value.deserializer"));
      return props;
  }//here as only value can be mapped to "key.deserializer" is there anyway to do this
  </code></pre>
  
  <p>in the main method</p>
  
  <pre><code>KafkaConsumer&lt;String, String&gt; _consumer = new KafkaConsumer&lt;&gt;(getProps());
  consumers.add(_consumer);
  _consumer.subscribe(new ArrayList&lt;&gt;(topicConsumer.keySet()));
  </code></pre>