@Test public void testNull() { SchemaRegistryClient nullSchemaRegistryClient = null; KafkaAvroSerializer nullAvroSerializer = new KafkaAvroSerializer(nullSchemaRegistryClient); assertEquals(null, nullAvroSerializer.serialize("test", null)); }
@Override public byte[] serialize(String topic, Object record) { if (record == null) { return null; } AvroSchema schema = new AvroSchema(AvroSchemaUtils.getSchema(record, useSchemaReflection)); return serializeImpl(getSubjectName(topic, isKey, record, schema), record, schema); }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { @Override public byte[] serialize(String topic, Object record) { if (record == null) { return null; } AvroSchema schema = new AvroSchema(AvroSchemaUtils.getSchema(record, useSchemaReflection)); return serializeImpl(getSubjectName(topic, isKey, record, schema), record, schema); } }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { @Override public byte[] serialize(String topic, Object record) { if (record == null) { return null; } AvroSchema schema = new AvroSchema(AvroSchemaUtils.getSchema(record, useSchemaReflection)); return serializeImpl(getSubjectName(topic, isKey, record, schema), record, schema); } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { @Override public byte[] serialize(String topic, Object record) { if (record == null) { return null; } AvroSchema schema = new AvroSchema(AvroSchemaUtils.getSchema(record, useSchemaReflection)); return serializeImpl(getSubjectName(topic, isKey, record, schema), record, schema); } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, Object record); @Override void close(); }
KafkaAvroSerializer extends AbstractKafkaAvroSerializer implements Serializer<Object> { @Override public byte[] serialize(String topic, Object record) { if (record == null) { return null; } AvroSchema schema = new AvroSchema(AvroSchemaUtils.getSchema(record, useSchemaReflection)); return serializeImpl(getSubjectName(topic, isKey, record, schema), record, schema); } KafkaAvroSerializer();  KafkaAvroSerializer(SchemaRegistryClient client);  KafkaAvroSerializer(SchemaRegistryClient client, Map<String, ?> props); @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, Object record); @Override void close();  }