Java源码示例:org.apache.kafka.connect.json.JsonConverterConfig
示例1
@Override
public void configure(Map<String, ?> configs, boolean isKey) {
super.configure(configs, isKey);
Map<String, Object> wrapper = new HashMap<>(configs);
wrapper.put(JsonConverterConfig.SCHEMAS_ENABLE_CONFIG, false);
jsonConverter.configure(wrapper, isKey);
}
示例2
public JsonPayloadFormatter() {
converter.configure(emptyMap(), false);
Map<String, String> configs = new HashMap<>();
configs.put(JsonConverterConfig.SCHEMAS_ENABLE_CONFIG, "false");
converterSansSchema.configure(configs, false);
deserializer.configure(emptyMap(), false);
}
示例3
public void open(Map<String, Object> config, SourceContext sourceContext) throws Exception {
if (config.get(JSON_WITH_ENVELOPE_CONFIG) != null) {
jsonWithEnvelope = Boolean.parseBoolean(config.get(JSON_WITH_ENVELOPE_CONFIG).toString());
config.put(JsonConverterConfig.SCHEMAS_ENABLE_CONFIG, jsonWithEnvelope);
} else {
config.put(JsonConverterConfig.SCHEMAS_ENABLE_CONFIG, false);
}
log.info("jsonWithEnvelope: {}", jsonWithEnvelope);
super.open(config, sourceContext);
}