@Test public void testKafkaAvroSerializerReflectionRecordWithPrimitives() { byte[] bytes; Object obj; String message = "testKafkaAvroSerializerReflectionRecordWithPrimitives"; Schema schema = AvroSchemaUtils.getSchema(message); bytes = avroSerializer.serialize(topic, message); obj = avroDecoder.fromBytes(bytes); assertTrue("Returned object should be a String", String.class.isInstance(obj)); assertEquals(message, obj); obj = avroDeserializer.deserialize(topic, bytes); assertTrue("Returned object should be a String", String.class.isInstance(obj)); assertEquals(message, obj); obj = reflectionAvroDecoder.fromBytes(bytes, schema); assertTrue("Returned object should be a String", String.class.isInstance(obj)); assertEquals(message, obj); obj = reflectionAvroDeserializer.deserialize(topic, bytes, schema); assertTrue("Returned object should be a String", String.class.isInstance(obj)); assertEquals(message, obj); }
@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();  }