@Test public void testVersionExtractedForDefaultSubjectNameStrategy() throws Exception { String subject = TOPIC + "-value"; KafkaJsonSchemaSerializer serializer = new KafkaJsonSchemaSerializer(schemaRegistry, ImmutableMap.of("schema.registry.url", "http: ); JsonSchemaConverter jsonConverter = new JsonSchemaConverter(schemaRegistry); jsonConverter.configure(Collections.singletonMap("schema.registry.url", "http: false ); testVersionExtracted(subject, serializer, jsonConverter); }
@Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; JsonSchemaConverterConfig jsonSchemaConverterConfig = new JsonSchemaConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( jsonSchemaConverterConfig.getSchemaRegistryUrls(), jsonSchemaConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new JsonSchemaProvider()), configs, jsonSchemaConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); jsonSchemaData = new JsonSchemaData(new JsonSchemaDataConfig(configs)); }
JsonSchemaConverter extends AbstractKafkaSchemaSerDe implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; JsonSchemaConverterConfig jsonSchemaConverterConfig = new JsonSchemaConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( jsonSchemaConverterConfig.getSchemaRegistryUrls(), jsonSchemaConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new JsonSchemaProvider()), configs, jsonSchemaConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); jsonSchemaData = new JsonSchemaData(new JsonSchemaDataConfig(configs)); } }
JsonSchemaConverter extends AbstractKafkaSchemaSerDe implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; JsonSchemaConverterConfig jsonSchemaConverterConfig = new JsonSchemaConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( jsonSchemaConverterConfig.getSchemaRegistryUrls(), jsonSchemaConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new JsonSchemaProvider()), configs, jsonSchemaConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); jsonSchemaData = new JsonSchemaData(new JsonSchemaDataConfig(configs)); } JsonSchemaConverter(); @VisibleForTesting  JsonSchemaConverter(SchemaRegistryClient client); }
JsonSchemaConverter extends AbstractKafkaSchemaSerDe implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; JsonSchemaConverterConfig jsonSchemaConverterConfig = new JsonSchemaConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( jsonSchemaConverterConfig.getSchemaRegistryUrls(), jsonSchemaConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new JsonSchemaProvider()), configs, jsonSchemaConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); jsonSchemaData = new JsonSchemaData(new JsonSchemaDataConfig(configs)); } JsonSchemaConverter(); @VisibleForTesting  JsonSchemaConverter(SchemaRegistryClient client); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] fromConnectData(String topic, Schema schema, Object value); @Override SchemaAndValue toConnectData(String topic, byte[] value); }
JsonSchemaConverter extends AbstractKafkaSchemaSerDe implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; JsonSchemaConverterConfig jsonSchemaConverterConfig = new JsonSchemaConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( jsonSchemaConverterConfig.getSchemaRegistryUrls(), jsonSchemaConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new JsonSchemaProvider()), configs, jsonSchemaConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); jsonSchemaData = new JsonSchemaData(new JsonSchemaDataConfig(configs)); } JsonSchemaConverter(); @VisibleForTesting  JsonSchemaConverter(SchemaRegistryClient client); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] fromConnectData(String topic, Schema schema, Object value); @Override SchemaAndValue toConnectData(String topic, byte[] value);  }