@Test public void testAvroDecoder() { String topic = "testAvro"; Object avroRecord = createAvroRecordVersion1(); byte[] payload = avroSerializer.serialize(topic, avroRecord); AvroMessageDecoder decoder = createAvroDecoder(topic, true, schemaRegistry); Object record = decoder.decode(payload).getRecord(); assertEquals(avroRecord, record); payload = avroEncoder.toBytes(avroRecord); AvroMessageDecoder decoder2 = createAvroDecoder(topic, false, schemaRegistry); record = decoder2.decode(payload).getRecord(); assertEquals(avroRecord, record); }
public CamusWrapper<Record> decode(byte[] payload) { Object object = deserialize(payload); if (object instanceof Record) { return new CamusAvroWrapper((Record) object); } else { throw new MessageDecoderException("Camus does not support Avro primitive types!"); } }
AvroMessageDecoder extends MessageDecoder<byte[], Record> { public CamusWrapper<Record> decode(byte[] payload) { Object object = deserialize(payload); if (object instanceof Record) { return new CamusAvroWrapper((Record) object); } else { throw new MessageDecoderException("Camus does not support Avro primitive types!"); } } }
AvroMessageDecoder extends MessageDecoder<byte[], Record> { public CamusWrapper<Record> decode(byte[] payload) { Object object = deserialize(payload); if (object instanceof Record) { return new CamusAvroWrapper((Record) object); } else { throw new MessageDecoderException("Camus does not support Avro primitive types!"); } } AvroMessageDecoder(SchemaRegistryClient schemaRegistry);  AvroMessageDecoder(); }
AvroMessageDecoder extends MessageDecoder<byte[], Record> { public CamusWrapper<Record> decode(byte[] payload) { Object object = deserialize(payload); if (object instanceof Record) { return new CamusAvroWrapper((Record) object); } else { throw new MessageDecoderException("Camus does not support Avro primitive types!"); } } AvroMessageDecoder(SchemaRegistryClient schemaRegistry);  AvroMessageDecoder(); @Override void init(Properties props, String topicName); CamusWrapper<Record> decode(byte[] payload); }
AvroMessageDecoder extends MessageDecoder<byte[], Record> { public CamusWrapper<Record> decode(byte[] payload) { Object object = deserialize(payload); if (object instanceof Record) { return new CamusAvroWrapper((Record) object); } else { throw new MessageDecoderException("Camus does not support Avro primitive types!"); } } AvroMessageDecoder(SchemaRegistryClient schemaRegistry);  AvroMessageDecoder(); @Override void init(Properties props, String topicName); CamusWrapper<Record> decode(byte[] payload);  }