Apache Flink: How to write from Apache Kafka to Apache Cassandra with Flink

Author: phisinger

Originally Sourced from: https://stackoverflow.com/questions/68459442/apache-flink-how-to-write-from-apache-kafka-to-apache-cassandra-with-flink

I want to write data from Kafka to Cassandra with Flink. The messages in Kafka are serialized via Avro schema which is managed by a Confluent schema registry. I have already got

  • a Kafka Consumer, which can consume the Avro messages properly
  • and a CassandraSink which can write data with Flink's datatype Row

I've already tried to use AvroRowDeserializationSchema (see here) but this didn't work due to the Confluent schema registry. Unfortunately, I couldn't find any resources to deserialize Confluent Avro to Row.
But maybe there is a completely different and easier way to achieve this simple goal (read Confluent Avro and write to Cassandra table). I would really appreciate any hint or idea.