Class AbstractKafkaJsonSchemaSerializer<T>
java.lang.Object
io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
io.confluent.kafka.serializers.json.AbstractKafkaJsonSchemaSerializer<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.ClusterResourceListener,org.apache.kafka.common.metrics.Monitorable
- Direct Known Subclasses:
KafkaJsonSchemaSerializer
-
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 booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected com.fasterxml.jackson.databind.ObjectMapperprotected booleanprotected booleanprotected SpecificationVersionprotected Stringprotected intprotected booleanprotected 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 voidcom.fasterxml.jackson.databind.ObjectMapperprotected byte[]serializeImpl(String subject, String topic, Boolean key, org.apache.kafka.common.header.Headers headers, T object, JsonSchema schema) protected byte[]serializeImpl(String subject, T object, JsonSchema schema) protected KafkaJsonSchemaSerializerConfigserializerConfig(Map<String, ?> props) protected TvalidateJson(T object, JsonSchema schema) Methods inherited from class io.confluent.kafka.serializers.AbstractKafkaSchemaSerDe
clearKey, close, configureClientProperties, executeMigrations, executeRules, executeRules, executeRules, executeRules, executeValidationRules, getById, getBySubjectAndId, getContextName, getContextName, getLatestWithMetadata, getMigrations, getOldSubjectName, getRuleActions, getRuleExecutors, getSchemaById, getSchemaBySchemaId, getSchemaBySubjectAndId, getSchemaEntityBySubjectAndId, getSchemaRegistryClient, getSubjectName, initValidationRuleExecutor, isKey, key, latestVersionsCache, latestWithMetadataCache, lookupLatestVersion, lookupLatestVersion, lookupSchemaByGuid, lookupSchemaBySubjectAndId, lookupSchemaEntityBySubjectAndId, onUpdate, postOp, register, register, register, registerWithResponse, schemaIdDeserializer, schemaIdSerializer, setKey, strategyUsesSchema, ticker, toKafkaException, withPluginMetrics
-
Field Details
-
normalizeSchema
protected boolean normalizeSchema -
autoRegisterSchema
protected boolean autoRegisterSchema -
propagateSchemaTags
protected boolean propagateSchemaTags -
useSchemaId
protected int useSchemaId -
useSchemaGuid
-
idCompatStrict
protected boolean idCompatStrict -
latestCompatStrict
protected boolean latestCompatStrict -
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper -
specVersion
-
scanPackages
-
envelopeDetection
protected boolean envelopeDetection -
oneofForNullables
protected boolean oneofForNullables -
failUnknownProperties
protected boolean failUnknownProperties -
validate
protected boolean validate -
validateBeforeDomainRules
protected boolean validateBeforeDomainRules -
validationRulesExecution
-
-
Constructor Details
-
AbstractKafkaJsonSchemaSerializer
public AbstractKafkaJsonSchemaSerializer()
-
-
Method Details
-
configure
-
serializerConfig
-
objectMapper
public com.fasterxml.jackson.databind.ObjectMapper objectMapper() -
serializeImpl
protected byte[] serializeImpl(String subject, T object, JsonSchema schema) 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
-
serializeImpl
protected byte[] serializeImpl(String subject, String topic, Boolean key, org.apache.kafka.common.header.Headers headers, T object, JsonSchema schema) 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
-
validateJson
protected T validateJson(T object, JsonSchema schema) throws org.apache.kafka.common.errors.SerializationException - Throws:
org.apache.kafka.common.errors.SerializationException
-