If using kafka-avro-console-producer to produce messages with a key, then the key must be Avro type. It does not allow non-Avro keys. If trying to produce non-Avro keys, a message is thrown from:
org.apache.kafka.common.config.ConfigException: Must provide the Avro schema string in key.schema
at io.confluent.kafka.formatter.AvroMessageReader.init(AvroMessageReader.java:150)
at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:42)
at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala)
Also somewhat related issue to producing Long keys: https://issues.apache.org/jira/browse/KAFKA-2526
Link #935
Most helpful comment
Link #935