Class ProtobufKafkaSerializer<U extends com.google.protobuf.Message>
java.lang.Object
io.apicurio.registry.serde.SchemaResolverConfigurer<T,U>
io.apicurio.registry.serde.AbstractKafkaSerDe<T,U>
io.apicurio.registry.serde.AbstractKafkaSerializer<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U>
io.apicurio.registry.serde.protobuf.ProtobufKafkaSerializer<U>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.serialization.Serializer<U>
public class ProtobufKafkaSerializer<U extends com.google.protobuf.Message>
extends AbstractKafkaSerializer<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U>
- Author:
- Ales Justin, Hiram Chirino, Fabian Martinez
-
Field Summary
Fields inherited from class io.apicurio.registry.serde.AbstractKafkaSerDe
headersHandler, idHandler, key, log, MAGIC_BYTEFields inherited from class io.apicurio.registry.serde.SchemaResolverConfigurer
schemaResolver -
Constructor Summary
ConstructorsConstructorDescriptionProtobufKafkaSerializer(io.apicurio.registry.resolver.SchemaResolver<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> schemaResolver) ProtobufKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client) ProtobufKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, io.apicurio.registry.resolver.strategy.ArtifactReferenceResolverStrategy<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> artifactResolverStrategy, io.apicurio.registry.resolver.SchemaResolver<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> schemaResolver) -
Method Summary
Modifier and TypeMethodDescriptionvoidio.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U> protected voidserializeData(io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> schema, U data, OutputStream out) protected voidserializeData(org.apache.kafka.common.header.Headers headers, io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> schema, U data, OutputStream out) Methods inherited from class io.apicurio.registry.serde.AbstractKafkaSerializer
close, serialize, serializeMethods inherited from class io.apicurio.registry.serde.AbstractKafkaSerDe
asLegacyId, configure, getByteBuffer, getIdHandler, isKey, reset, setHeadersHandler, setIdHandlerMethods inherited from class io.apicurio.registry.serde.SchemaResolverConfigurer
configure, getSchemaResolver, setSchemaResolver
-
Constructor Details
-
ProtobufKafkaSerializer
public ProtobufKafkaSerializer() -
ProtobufKafkaSerializer
public ProtobufKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client, io.apicurio.registry.resolver.strategy.ArtifactReferenceResolverStrategy<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> artifactResolverStrategy, io.apicurio.registry.resolver.SchemaResolver<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> schemaResolver) -
ProtobufKafkaSerializer
public ProtobufKafkaSerializer(io.apicurio.registry.rest.client.RegistryClient client) -
ProtobufKafkaSerializer
public ProtobufKafkaSerializer(io.apicurio.registry.resolver.SchemaResolver<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema, U> schemaResolver)
-
-
Method Details
-
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.serialization.Serializer<U extends com.google.protobuf.Message>- Overrides:
configurein classAbstractKafkaSerializer<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message>
-
schemaParser
public io.apicurio.registry.resolver.SchemaParser<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U> schemaParser()- Specified by:
schemaParserin classAbstractKafkaSerDe<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message> - See Also:
-
serializeData
protected void serializeData(io.apicurio.registry.resolver.ParsedSchema<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> schema, U data, OutputStream out) throws IOException - Specified by:
serializeDatain classAbstractKafkaSerializer<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message> - 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<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema> schema, U data, OutputStream out) throws IOException - Specified by:
serializeDatain classAbstractKafkaSerializer<io.apicurio.registry.utils.protobuf.schema.ProtobufSchema,U extends com.google.protobuf.Message> - 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)
-