Package com.solace.serdes.avro
Class AvroDeserializer<T>
- java.lang.Object
-
- com.solace.serdes.common.AbstractDeserializer<T,org.apache.avro.Schema>
-
- com.solace.serdes.avro.AvroDeserializer<T>
-
- Type Parameters:
T- The type of object this deserializer produces.
- All Implemented Interfaces:
com.solace.serdes.Deserializer<T>,Closeable,AutoCloseable
public class AvroDeserializer<T> extends AbstractDeserializer<T,org.apache.avro.Schema>
A deserializer for Avro-formatted data that converts byte arrays into objects of type T. This class extendsAbstractDeserializerand implements the deserialization logic specific to Avro schemas. Supported Avro types includeGenericRecordandSpecificRecord.
AvroDeserializerdoes not support non-header decoding of schema ID. Must useAbstractDeserializer.deserialize(String, byte[], Map)to ensure the schema ID is available for schema resolution. UsingAbstractDeserializer.deserialize(String, byte[])will not resolve the payload schema.
Note: A Vertx connection will be made when configuring thisAvroDeserializer. Vertx threads are non-daemon and will prevent JVM exit, so always remember to callAbstractDeserializer.close().- See Also:
AvroProperties,AvroHeaders
-
-
Constructor Summary
Constructors Constructor Description AvroDeserializer()Creates an instance of an AvroDeserializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(Map<String,?> properties)Configures the deserializer with the given properties.-
Methods inherited from class com.solace.serdes.common.AbstractDeserializer
close, deserialize, deserialize
-
-
-
-
Constructor Detail
-
AvroDeserializer
public AvroDeserializer()
Creates an instance of an AvroDeserializer. Once created,configure(java.util.Map)must be called to use this instance.
-
-
Method Detail
-
configure
public void configure(Map<String,?> properties)
Configures the deserializer with the given properties. Properties are defined inAvroPropertiesandSerdeProperties
Note: A Vertx connection will be made when configuring thisAvroDeserializer. Vertx threads are non-daemon and will prevent JVM exit, so always remember to callAbstractDeserializer.close().- Specified by:
configurein interfacecom.solace.serdes.Deserializer<T>- Overrides:
configurein classAbstractDeserializer<T,org.apache.avro.Schema>- Parameters:
properties- A Map containing configuration properties.- See Also:
AvroProperties,SerdeProperties
-
-