All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.atleon.schemaregistry.confluent.AvroRegistryKafkaSerializer Maven / Gradle / Ivy

There is a newer version: 0.28.3
Show newest version
package io.atleon.schemaregistry.confluent;

import org.apache.kafka.common.serialization.Serializer;

import java.util.Map;

/**
 * A Kafka {@link Serializer} that delegates to {@link AvroRegistrySerializer}
 *
 * @param  The type of data serialized by this serializer
 */
public final class AvroRegistryKafkaSerializer implements Serializer {

    private final AvroRegistrySerializer delegate = new AvroRegistrySerializer<>();

    private boolean isKey = false;

    @Override
    public void configure(Map configs, boolean isKey) {
        delegate.configure(configs);
        this.isKey = isKey;
    }

    @Override
    public byte[] serialize(String topic, T data) {
        return delegate.serialize(topic, isKey, data);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy