public abstract class SchemaMessageReader<T> extends Object implements org.apache.kafka.tools.api.RecordReader
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_SCHEMA |
protected ParsedSchema |
keySchema |
static String |
VALUE_SCHEMA |
protected ParsedSchema |
valueSchema |
| Constructor and Description |
|---|
SchemaMessageReader()
Constructor needed by kafka console producer.
|
SchemaMessageReader(String url,
ParsedSchema keySchema,
ParsedSchema valueSchema,
String topic,
boolean parseKey,
boolean normalizeSchema,
boolean autoRegister,
boolean useLatest)
For testing only.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Map<String,?> configs) |
protected abstract SchemaMessageSerializer<T> |
createSerializer(org.apache.kafka.common.serialization.Serializer keySerializer) |
protected abstract SchemaProvider |
getProvider() |
void |
init(Properties props) |
protected ParsedSchema |
parseSchema(SchemaRegistryClient schemaRegistry,
String schema,
List<SchemaReference> references) |
protected abstract T |
readFrom(String jsonString,
ParsedSchema schema) |
Iterator<org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>> |
readRecords(InputStream inputStream) |
public static final String VALUE_SCHEMA
public static final String KEY_SCHEMA
protected ParsedSchema keySchema
protected ParsedSchema valueSchema
public SchemaMessageReader()
public SchemaMessageReader(String url, ParsedSchema keySchema, ParsedSchema valueSchema, String topic, boolean parseKey, boolean normalizeSchema, boolean autoRegister, boolean useLatest)
protected abstract SchemaMessageSerializer<T> createSerializer(org.apache.kafka.common.serialization.Serializer keySerializer)
public void configure(Map<String,?> configs)
configure in interface org.apache.kafka.common.Configurableconfigure in interface org.apache.kafka.tools.api.RecordReaderpublic void init(Properties props)
protected ParsedSchema parseSchema(SchemaRegistryClient schemaRegistry, String schema, List<SchemaReference> references)
public Iterator<org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>> readRecords(InputStream inputStream)
readRecords in interface org.apache.kafka.tools.api.RecordReaderprotected abstract T readFrom(String jsonString, ParsedSchema schema)
public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.kafka.tools.api.RecordReaderprotected abstract SchemaProvider getProvider()
Copyright © 2025 Confluent, Inc.. All rights reserved.