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.resolver.SchemaResolver<org.apache.avro.Schema,U> schemaResolver)AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client)AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, io.apicurio.registry.resolver.strategy.ArtifactReferenceResolverStrategy<org.apache.avro.Schema,U> artifactResolverStrategy, io.apicurio.registry.resolver.SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Map<String,?> configs, boolean isKey)io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U>schemaParser()protected voidserializeData(io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out)protected voidserializeData(org.apache.kafka.common.header.Headers headers, io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out)-
Methods inherited from class io.apicurio.registry.serde.AbstractKafkaSerializer
close, 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(io.apicurio.registry.resolver.SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
AvroKafkaSerializer
public AvroKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, io.apicurio.registry.resolver.strategy.ArtifactReferenceResolverStrategy<org.apache.avro.Schema,U> artifactResolverStrategy, io.apicurio.registry.resolver.SchemaResolver<org.apache.avro.Schema,U> schemaResolver)
-
-
Method Detail
-
configure
public void configure(Map<String,?> configs, boolean isKey)
- Specified by:
configurein interfaceorg.apache.kafka.common.serialization.Serializer<U>- Overrides:
configurein classAbstractKafkaSerializer<org.apache.avro.Schema,U>
-
schemaParser
public io.apicurio.registry.resolver.SchemaParser<org.apache.avro.Schema,U> schemaParser()
- Specified by:
schemaParserin classAbstractKafkaSerDe<org.apache.avro.Schema,U>- See Also:
AbstractKafkaSerDe.schemaParser()
-
serializeData
protected void serializeData(io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out) throws IOException- Specified by:
serializeDatain classAbstractKafkaSerializer<org.apache.avro.Schema,U>- Throws:
IOException- See Also:
io.apicurio.registry.serde.AbstractKafkaSerializer#serializeData(io.apicurio.registry.serde.ParsedSchema, java.lang.Object, java.io.OutputStream)
-
serializeData
protected void serializeData(org.apache.kafka.common.header.Headers headers, io.apicurio.registry.resolver.ParsedSchema<org.apache.avro.Schema> schema, U data, OutputStream out) throws IOException- Specified by:
serializeDatain classAbstractKafkaSerializer<org.apache.avro.Schema,U>- Throws:
IOException- See Also:
io.apicurio.registry.serde.AbstractKafkaSerializer#serializeData(org.apache.kafka.common.header.Headers, io.apicurio.registry.serde.ParsedSchema, java.lang.Object, java.io.OutputStream)
-
-