|
@@ -62,14 +62,12 @@ public class SchemaRegistryAwareRecordSerDe implements RecordSerDe {
|
|
@Nullable
|
|
@Nullable
|
|
private final JsonSchemaMessageFormatter jsonSchemaMessageFormatter;
|
|
private final JsonSchemaMessageFormatter jsonSchemaMessageFormatter;
|
|
|
|
|
|
- private ObjectMapper objectMapper;
|
|
|
|
|
|
+ private final ObjectMapper objectMapper;
|
|
|
|
|
|
- private SchemaRegistryClient createSchemaRegistryClient(KafkaCluster cluster,
|
|
|
|
- ObjectMapper objectMapper) {
|
|
|
|
|
|
+ private SchemaRegistryClient createSchemaRegistryClient(KafkaCluster cluster) {
|
|
if (cluster.getSchemaRegistry() == null) {
|
|
if (cluster.getSchemaRegistry() == null) {
|
|
throw new ValidationException("schemaRegistry is not specified");
|
|
throw new ValidationException("schemaRegistry is not specified");
|
|
}
|
|
}
|
|
- this.objectMapper = objectMapper;
|
|
|
|
|
|
|
|
List<SchemaProvider> schemaProviders =
|
|
List<SchemaProvider> schemaProviders =
|
|
List.of(new AvroSchemaProvider(), new ProtobufSchemaProvider(), new JsonSchemaProvider());
|
|
List.of(new AvroSchemaProvider(), new ProtobufSchemaProvider(), new JsonSchemaProvider());
|
|
@@ -98,8 +96,9 @@ public class SchemaRegistryAwareRecordSerDe implements RecordSerDe {
|
|
|
|
|
|
public SchemaRegistryAwareRecordSerDe(KafkaCluster cluster, ObjectMapper objectMapper) {
|
|
public SchemaRegistryAwareRecordSerDe(KafkaCluster cluster, ObjectMapper objectMapper) {
|
|
this.cluster = cluster;
|
|
this.cluster = cluster;
|
|
|
|
+ this.objectMapper = objectMapper;
|
|
this.schemaRegistryClient = cluster.getSchemaRegistry() != null
|
|
this.schemaRegistryClient = cluster.getSchemaRegistry() != null
|
|
- ? createSchemaRegistryClient(cluster, objectMapper)
|
|
|
|
|
|
+ ? createSchemaRegistryClient(cluster)
|
|
: null;
|
|
: null;
|
|
if (schemaRegistryClient != null) {
|
|
if (schemaRegistryClient != null) {
|
|
this.avroFormatter = new AvroMessageFormatter(schemaRegistryClient);
|
|
this.avroFormatter = new AvroMessageFormatter(schemaRegistryClient);
|