@Test public void testVersionExtractedForRecordSubjectNameStrategy() throws Exception { String subject = "Foo"; Map<String, Object> configs = ImmutableMap.<String, Object>of("schema.registry.url", "http: KafkaAvroSerializer serializer = new KafkaAvroSerializer(schemaRegistry); serializer.configure(configs, false); AvroConverter avroConverter = new AvroConverter(schemaRegistry); avroConverter.configure(configs, false); testVersionExtracted(subject, serializer, avroConverter); }
@Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; AvroConverterConfig avroConverterConfig = new AvroConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( avroConverterConfig.getSchemaRegistryUrls(), avroConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new AvroSchemaProvider()), configs, avroConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); avroData = new AvroData(new AvroDataConfig(configs)); }
AvroConverter implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; AvroConverterConfig avroConverterConfig = new AvroConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( avroConverterConfig.getSchemaRegistryUrls(), avroConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new AvroSchemaProvider()), configs, avroConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); avroData = new AvroData(new AvroDataConfig(configs)); } }
AvroConverter implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; AvroConverterConfig avroConverterConfig = new AvroConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( avroConverterConfig.getSchemaRegistryUrls(), avroConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new AvroSchemaProvider()), configs, avroConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); avroData = new AvroData(new AvroDataConfig(configs)); } AvroConverter();  AvroConverter(SchemaRegistryClient client); }
AvroConverter implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; AvroConverterConfig avroConverterConfig = new AvroConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( avroConverterConfig.getSchemaRegistryUrls(), avroConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new AvroSchemaProvider()), configs, avroConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); avroData = new AvroData(new AvroDataConfig(configs)); } AvroConverter();  AvroConverter(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); }
AvroConverter implements Converter { @Override public void configure(Map<String, ?> configs, boolean isKey) { this.isKey = isKey; AvroConverterConfig avroConverterConfig = new AvroConverterConfig(configs); if (schemaRegistry == null) { schemaRegistry = new CachedSchemaRegistryClient( avroConverterConfig.getSchemaRegistryUrls(), avroConverterConfig.getMaxSchemasPerSubject(), Collections.singletonList(new AvroSchemaProvider()), configs, avroConverterConfig.requestHeaders() ); } serializer = new Serializer(configs, schemaRegistry); deserializer = new Deserializer(configs, schemaRegistry); avroData = new AvroData(new AvroDataConfig(configs)); } AvroConverter();  AvroConverter(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);  }