serialize

fun serialize(topic: String, value: Any): ByteArray(source)

Serializes value for the given topic and returns the Confluent Avro wire-format bytes (registers the schema in Schema Registry on first use). value must be an Avro SpecificRecord or GenericRecord.