Package io.apicurio.registry.serde.avro
Class AvroKafkaSerializer<U>
- java.lang.Object
-
- io.apicurio.registry.serde.SchemaResolverConfigurer<T,U>
-
- io.apicurio.registry.serde.AbstractKafkaSerDe<T,U>
-
- io.apicurio.registry.serde.AbstractKafkaSerializer<org.apache.avro.Schema,U>
-
- io.apicurio.registry.serde.avro.AvroKafkaSerializer<U>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.serialization.Serializer<U>
public class AvroKafkaSerializer<U> extends AbstractKafkaSerializer<org.apache.avro.Schema,U>
- Author:
- Ales Justin, Fabian Martinez
-
-
Field Summary
-
Fields inherited from class io.apicurio.registry.serde.AbstractKafkaSerDe
headersHandler, idHandler, key, log, MAGIC_BYTE
-
Fields inherited from class io.apicurio.registry.serde.SchemaResolverConfigurer
schemaResolver
-
-
Constructor Summary
Constructors Constructor Description AvroKafkaSerializer()
AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client)
AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, ArtifactResolverStrategy<org.apache.avro.Schema> artifactResolverStrategy, SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
AvroKafkaSerializer(SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Map<String,?> configs, boolean isKey)
protected ParsedSchema<org.apache.avro.Schema>
getSchemaFromData(U data)
SchemaParser<org.apache.avro.Schema>
schemaParser()
protected void
serializeData(ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out)
protected void
serializeData(org.apache.kafka.common.header.Headers headers, ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out)
-
Methods inherited from class io.apicurio.registry.serde.AbstractKafkaSerializer
serialize, serialize
-
Methods inherited from class io.apicurio.registry.serde.AbstractKafkaSerDe
asLegacyId, configure, getByteBuffer, getIdHandler, isKey, reset, setHeadersHandler, setIdHandler
-
Methods inherited from class io.apicurio.registry.serde.SchemaResolverConfigurer
configure, getSchemaResolver, setSchemaResolver
-
-
-
-
Constructor Detail
-
AvroKafkaSerializer
public AvroKafkaSerializer()
-
AvroKafkaSerializer
public AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client)
-
AvroKafkaSerializer
public AvroKafkaSerializer(SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
AvroKafkaSerializer
public AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, ArtifactResolverStrategy<org.apache.avro.Schema> artifactResolverStrategy, SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
-
Method Detail
-
configure
public void configure(Map<String,?> configs, boolean isKey)
- Specified by:
configure
in interfaceorg.apache.kafka.common.serialization.Serializer<U>
- Overrides:
configure
in classAbstractKafkaSerializer<org.apache.avro.Schema,U>
-
schemaParser
public SchemaParser<org.apache.avro.Schema> schemaParser()
- Specified by:
schemaParser
in classAbstractKafkaSerDe<org.apache.avro.Schema,U>
- See Also:
AbstractKafkaSerDe.schemaParser()
-
getSchemaFromData
protected ParsedSchema<org.apache.avro.Schema> getSchemaFromData(U data)
- Overrides:
getSchemaFromData
in classAbstractKafkaSerializer<org.apache.avro.Schema,U>
- See Also:
AbstractKafkaSerializer.getSchemaFromData(java.lang.Object)
-
serializeData
protected void serializeData(ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out) throws IOException
- Specified by:
serializeData
in classAbstractKafkaSerializer<org.apache.avro.Schema,U>
- Throws:
IOException
- See Also:
AbstractKafkaSerializer.serializeData(io.apicurio.registry.serde.ParsedSchema, java.lang.Object, java.io.OutputStream)
-
serializeData
protected void serializeData(org.apache.kafka.common.header.Headers headers, ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out) throws IOException
- Specified by:
serializeData
in classAbstractKafkaSerializer<org.apache.avro.Schema,U>
- Throws:
IOException
- See Also:
AbstractKafkaSerializer.serializeData(org.apache.kafka.common.header.Headers, io.apicurio.registry.serde.ParsedSchema, java.lang.Object, java.io.OutputStream)
-
-