Class AWSKafkaAvroDeserializer

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.kafka.common.serialization.Deserializer<Object>

    public class AWSKafkaAvroDeserializer
    extends Object
    implements org.apache.kafka.common.serialization.Deserializer<Object>
    AWS Kafka Avro Deserializer responsible for de-serializing the data using Avro protocol serializer.
    • Constructor Detail

      • AWSKafkaAvroDeserializer

        public AWSKafkaAvroDeserializer()
        Constructor used by Kafka consumer.
      • AWSKafkaAvroDeserializer

        public AWSKafkaAvroDeserializer​(@NonNull
                                        @NonNull Map<String,​?> configs)
      • AWSKafkaAvroDeserializer

        public AWSKafkaAvroDeserializer​(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentialProvider,
                                        Map<String,​?> configs)
        Constructor accepting AWSCredentialsProvider.
        Parameters:
        credentialProvider - AWSCredentialsProvider instance.
    • Method Detail

      • configure

        public void configure​(@NonNull
                              @NonNull Map<String,​?> configs,
                              boolean isKey)
        Configuration method for injecting configuration properties.
        Specified by:
        configure in interface org.apache.kafka.common.serialization.Deserializer<Object>
        Parameters:
        configs - configuration elements for de-serializer
        isKey - true if key, false otherwise
      • deserialize

        public Object deserialize​(String topic,
                                  byte[] data)
        De-serialize operation for de-serializing the byte array to an Object.
        Specified by:
        deserialize in interface org.apache.kafka.common.serialization.Deserializer<Object>
        Parameters:
        topic - Kafka topic name
        data - serialized data to be de-serialized in byte array
        Returns:
        de-serialized object instance
      • close

        public void close()
        Resource clean up for Closeable. This method internally shuts down the background thread for publishing cloud watch metrics. After this is called, a new instance of this class should be created to enable the metrics publishing feature.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.kafka.common.serialization.Deserializer<Object>