schema-registry icon indicating copy to clipboard operation
schema-registry copied to clipboard

Make the AbstractKafkaAvroSerDe Serializable

Open Fokko opened this issue 6 years ago • 5 comments

For our Flink job the SchemaRegistryClient is part of a task, and we would like to be able to Serialize this class and send it to the TaskManagers.

Fokko avatar May 06 '19 09:05 Fokko

It looks like @Fokko hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence. Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

ghost avatar May 06 '19 09:05 ghost

[clabot:check]

Fokko avatar May 06 '19 09:05 Fokko

@confluentinc It looks like @Fokko just signed our Contributor License Agreement. :+1:

Always at your service,

clabot

ghost avatar May 06 '19 09:05 ghost

He @Fokko, running into same issue.

I solved this part, but the CachedSchemaRegistryClient is not Serializable, so i'm unable to serialize the task. For Spark in my case. Trying to follow the guide: https://github.com/xebia-france/spark-structured-streaming-blog/blob/master/src/main/scala/AvroConsumer.scala.

class MyAvroDeserializer extends AbstractKafkaAvroDeserializer with Serializable {
  def this(client: SchemaRegistryClient) {
    this()
    this.schemaRegistry = client
  }

  override def deserialize(bytes: Array[Byte]): String = {
    val genericRecord = super.deserialize(bytes).asInstanceOf[GenericRecord]
    genericRecord.toString
  }
}

abij avatar Dec 24 '19 23:12 abij

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar Sep 25 '23 16:09 cla-assistant[bot]