Class HazelcastKafkaAvroSerializer

java.lang.Object
com.hazelcast.jet.kafka.impl.AbstractHazelcastAvroSerde
com.hazelcast.jet.kafka.HazelcastKafkaAvroSerializer
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.kafka.common.serialization.Serializer<org.apache.avro.generic.GenericRecord>

public class HazelcastKafkaAvroSerializer extends com.hazelcast.jet.kafka.impl.AbstractHazelcastAvroSerde implements org.apache.kafka.common.serialization.Serializer<org.apache.avro.generic.GenericRecord>
An Avro serializer for Kafka. Unlike io.confluent.kafka.serializers.KafkaAvroSerializer, this serializer does not use a schema registry. Instead, it obtains the schema from mapping options and use it for all messages. Consequently, the messages produced by this serializer does not include a schema id (and also "magic byte").
Since:
5.4
See Also:
  • Field Summary

    Fields inherited from class com.hazelcast.jet.kafka.impl.AbstractHazelcastAvroSerde

    OPTION_KEY_AVRO_SCHEMA, OPTION_VALUE_AVRO_SCHEMA
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor used by Kafka producer.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configure(Map<String,?> configs, boolean isKey)
     
    byte[]
    serialize(String topic, org.apache.avro.generic.GenericRecord record)
     

    Methods inherited from class com.hazelcast.jet.kafka.impl.AbstractHazelcastAvroSerde

    getSchema

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.kafka.common.serialization.Serializer

    close, serialize
  • Constructor Details

    • HazelcastKafkaAvroSerializer

      public HazelcastKafkaAvroSerializer()
      Constructor used by Kafka producer.
  • Method Details

    • configure

      public void configure(Map<String,?> configs, boolean isKey)
      Specified by:
      configure in interface org.apache.kafka.common.serialization.Serializer<org.apache.avro.generic.GenericRecord>
    • serialize

      public byte[] serialize(String topic, org.apache.avro.generic.GenericRecord record)
      Specified by:
      serialize in interface org.apache.kafka.common.serialization.Serializer<org.apache.avro.generic.GenericRecord>