Class AbstractKafkaProtobufDeserializer<T extends com.google.protobuf.Message>
java.lang.Object
io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
io.confluent.kafka.serializers.protobuf.AbstractKafkaProtobufDeserializer<T>
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
KafkaProtobufDeserializer
public abstract class AbstractKafkaProtobufDeserializer<T extends com.google.protobuf.Message>
extends AbstractKafkaSchemaSerDe
-
Nested Class Summary
Nested classes/interfaces inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
AbstractKafkaSchemaSerDe.ExtendedSchema, AbstractKafkaSchemaSerDe.Migration, AbstractKafkaSchemaSerDe.SubjectSchema -
Field Summary
FieldsFields inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
config, configOriginals, contextNameStrategy, enableRuleServiceLoader, executionEnv, isKey, keySchemaIdDeserializer, keySchemaIdSerializer, keySubjectNameStrategy, latestVersions, latestWithMetadata, metadata, ruleActions, ruleExecutors, schemaRegistry, ticker, useLatestVersion, useSchemaReflection, valueSchemaIdDeserializer, valueSchemaIdSerializer, valueSubjectNameStrategy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigure(KafkaProtobufDeserializerConfig config, Class<T> type) Sets properties for this deserializer without overriding the schema registry client itself.protected Objectdeserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, byte[] payload) protected Objectdeserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload) protected Objectdeserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, Function<ParsedSchema, ParsedSchema> writerToReaderSchemaFunc) protected Tdeserialize(byte[] payload) Deserializes the payload without including schema information for primitive types, maps, and arrays.protected KafkaProtobufDeserializerConfigdeserializerConfig(Map<String, ?> props) protected KafkaProtobufDeserializerConfigdeserializerConfig(Properties props) protected ProtobufSchemaAndValuedeserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload) protected ProtobufSchemaAndValuedeserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, Function<ParsedSchema, ParsedSchema> writerToReaderSchemaFunc) Methods inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
clearKey, close, configureClientProperties, executeMigrations, executeRules, executeRules, executeRules, getById, getBySubjectAndId, getContextName, getContextName, getLatestWithMetadata, getMigrations, getOldSubjectName, getRuleActions, getRuleExecutors, getSchemaById, getSchemaBySchemaId, getSchemaBySubjectAndId, getSchemaRegistryClient, getSubjectName, isKey, key, latestVersionsCache, latestWithMetadataCache, lookupLatestVersion, lookupLatestVersion, lookupSchemaBySubjectAndId, postOp, register, register, register, registerWithResponse, schemaIdDeserializer, schemaIdSerializer, setKey, strategyUsesSchema, ticker, toKafkaException
-
Field Details
-
specificProtobufClass
-
parseMethod
-
deriveType
protected boolean deriveType
-
-
Constructor Details
-
AbstractKafkaProtobufDeserializer
public AbstractKafkaProtobufDeserializer()
-
-
Method Details
-
configure
Sets properties for this deserializer without overriding the schema registry client itself. Useful for testing, where a mock client is injected. -
deserializerConfig
-
deserializerConfig
-
deserialize
protected T deserialize(byte[] payload) throws org.apache.kafka.common.errors.SerializationException, org.apache.kafka.common.errors.InvalidConfigurationException Deserializes the payload without including schema information for primitive types, maps, and arrays. Just the resulting deserialized object is returned.This behavior is the norm for Decoders/Deserializers.
- Parameters:
payload- serialized data- Returns:
- the deserialized object
- Throws:
org.apache.kafka.common.errors.SerializationExceptionorg.apache.kafka.common.errors.InvalidConfigurationException
-
deserialize
protected Object deserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, byte[] payload) throws org.apache.kafka.common.errors.SerializationException, org.apache.kafka.common.errors.InvalidConfigurationException - Throws:
org.apache.kafka.common.errors.SerializationExceptionorg.apache.kafka.common.errors.InvalidConfigurationException
-
deserialize
protected Object deserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload) throws org.apache.kafka.common.errors.SerializationException, org.apache.kafka.common.errors.InvalidConfigurationException - Throws:
org.apache.kafka.common.errors.SerializationExceptionorg.apache.kafka.common.errors.InvalidConfigurationException
-
deserialize
protected Object deserialize(boolean includeSchemaAndVersion, String topic, Boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, Function<ParsedSchema, ParsedSchema> writerToReaderSchemaFunc) throws org.apache.kafka.common.errors.SerializationException, org.apache.kafka.common.errors.InvalidConfigurationException- Throws:
org.apache.kafka.common.errors.SerializationExceptionorg.apache.kafka.common.errors.InvalidConfigurationException
-
deserializeWithSchemaAndVersion
protected ProtobufSchemaAndValue deserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload) throws org.apache.kafka.common.errors.SerializationException - Throws:
org.apache.kafka.common.errors.SerializationException
-
deserializeWithSchemaAndVersion
protected ProtobufSchemaAndValue deserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, Function<ParsedSchema, ParsedSchema> writerToReaderSchemaFunc) throws org.apache.kafka.common.errors.SerializationException- Throws:
org.apache.kafka.common.errors.SerializationException
-