@Test public void testSameSchemaMultipleTopicForKey() throws IOException, RestClientException { SchemaRegistryClient schemaRegistry = new MockSchemaRegistryClient(); JsonSchemaConverter jsonConverter = new JsonSchemaConverter(schemaRegistry); jsonConverter.configure(SR_CONFIG, true); assertSameSchemaMultipleTopic(jsonConverter, schemaRegistry, true); }
@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);  }