io.atleon.schemaregistry.confluent.AvroRegistryKafkaSerializer Maven / Gradle / Ivy
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);
}
}