See my answer here.
The relevant part:
“We had to modify the Mendix supplied Kafka module, but the changes were fairly straightforward. I duplicated a number of files and modified them to be able to handle avro messages:
The modifications in these files were mainly concerned with a different type: KafkaProducer<String, String> to KafkaProducer<String, byte[]> kafkaProducer. ... Once you have modified these files, the configuration options provided by the module are enough to make this work.”