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
  • 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

      public void configure(Map<String,?> configs, boolean isKey)
      Specified by:
      configure in interface org.apache.kafka.common.serialization.Serializer<U extends com.google.protobuf.Message>
      Overrides:
      configure in class AbstractKafkaSerializer<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:
      schemaParser in class AbstractKafkaSerDe<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:
      serializeData in class AbstractKafkaSerializer<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:
      serializeData in class AbstractKafkaSerializer<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)