mirror of https://github.com/apache/kafka.git
MINOR: Add doc for external schemas in JSONConverter (#20429)
This is a follow-up to #19449, which do the following things: 1. Add document to explain `schema.content` only work for sink connector when `schemas.enable` set to true. 2. Handle the case that while jsonValue contains the `schema` and `payload` fields, we should use the corresponding value. Reviewers: Priyanka K U <priyanka.ku@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
parent
f6f6172bd1
commit
350577d0ae
|
@ -222,7 +222,7 @@ public class JsonConverter implements Converter, HeaderConverter, Versioned {
|
|||
private JsonConverterConfig config;
|
||||
private Cache<Schema, ObjectNode> fromConnectSchemaCache;
|
||||
private Cache<JsonNode, Schema> toConnectSchemaCache;
|
||||
private Schema schema = null; // if a schema is provided in config, this schema will be used for all messages
|
||||
private Schema schema = null; // if a schema is provided in config, this schema will be used for all messages for sink connector
|
||||
|
||||
private final JsonSerializer serializer;
|
||||
private final JsonDeserializer deserializer;
|
||||
|
|
|
@ -38,7 +38,8 @@ public final class JsonConverterConfig extends ConverterConfig {
|
|||
|
||||
public static final String SCHEMA_CONTENT_CONFIG = "schema.content";
|
||||
public static final String SCHEMA_CONTENT_DEFAULT = null;
|
||||
private static final String SCHEMA_CONTENT_DOC = "When set, this is used as the schema for all messages. Otherwise, the schema will be included in the content of each message.";
|
||||
private static final String SCHEMA_CONTENT_DOC = "When set, this is used as the schema for all messages, and the schemas within each of the message will be ignored."
|
||||
+ "Otherwise, the schema will be included in the content of each message. This configuration applies only 'schemas.enable' is true, and it exclusively affects the sink connector.";
|
||||
private static final String SCHEMA_CONTENT_DISPLAY = "Schema Content";
|
||||
|
||||
public static final String SCHEMAS_CACHE_SIZE_CONFIG = "schemas.cache.size";
|
||||
|
|
Loading…
Reference in New Issue