Class AbstractKafkaJsonSchemaDeserializer<T>
java.lang.Object
io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
io.confluent.kafka.serializers.json.AbstractKafkaJsonSchemaDeserializer<T>
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
KafkaJsonSchemaDeserializer
-
Nested Class Summary
Nested classes/interfaces inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
AbstractKafkaSchemaSerDe.ExtendedSchema, AbstractKafkaSchemaSerDe.Migration, AbstractKafkaSchemaSerDe.SubjectSchema -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.fasterxml.jackson.databind.ObjectMapperprotected Stringprotected booleanFields inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
config, configOriginals, contextNameStrategy, DEFAULT_CACHE_CAPACITY, 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(KafkaJsonSchemaDeserializerConfig 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 KafkaJsonSchemaDeserializerConfigdeserializerConfig(Map<String, ?> props) protected KafkaJsonSchemaDeserializerConfigdeserializerConfig(Properties props) protected JsonSchemaAndValuedeserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload) protected JsonSchemaAndValuedeserializeWithSchemaAndVersion(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, Function<ParsedSchema, ParsedSchema> writerToReaderSchemaFunc) com.fasterxml.jackson.databind.ObjectMapperMethods 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
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
type
-
typeProperty
-
allowedTypePackages
-
validate
protected boolean validate
-
-
Constructor Details
-
AbstractKafkaJsonSchemaDeserializer
public AbstractKafkaJsonSchemaDeserializer()
-
-
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
-
objectMapper
public com.fasterxml.jackson.databind.ObjectMapper objectMapper() -
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 JsonSchemaAndValue 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 JsonSchemaAndValue 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
-