Package com.solace.serdes.jsonschema
Class JsonSchemaDeserializer<T>
- java.lang.Object
-
- com.solace.serdes.common.AbstractDeserializer<T,com.networknt.schema.JsonSchema>
-
- com.solace.serdes.jsonschema.JsonSchemaDeserializer<T>
-
- Type Parameters:
T
- The type of object this deserializer produces.
- All Implemented Interfaces:
com.solace.serdes.Deserializer<T>
,Closeable
,AutoCloseable
public class JsonSchemaDeserializer<T> extends AbstractDeserializer<T,com.networknt.schema.JsonSchema>
A deserializer for JsonSchema-formatted data that converts byte arrays into objects of type T. This class extendsAbstractDeserializer
and implements the deserialization logic specific to Json schemas. Returns a specific target java object of type T orJsonNode
when the target deserialized type can be not determined.
JsonSchemaDeserializer
does 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 thisJsonSchemaDeserializer
. Vertx threads are non-daemon and will prevent JVM exit, so always remember to callAbstractDeserializer.close()
. Calling close on another thread can orphan requests ensure no calls toAbstractDeserializer.deserialize(String, byte[], Map)
are not in progress whenAbstractDeserializer.close()
is called.
-
-
Constructor Summary
Constructors Constructor Description JsonSchemaDeserializer()
Constructs a new JsonSchemaDeserializer with default configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Map<String,?> properties)
Configures the deserializer with the given properties.-
Methods inherited from class com.solace.serdes.common.AbstractDeserializer
close, deserialize, deserialize
-
-
-
-
Method Detail
-
configure
public void configure(Map<String,?> properties)
Description copied from class:AbstractDeserializer
Configures the deserializer with the given properties. Properties are defined inSerdeProperties
Note: A Vertx connection will be made when configuring thisDeserializer
. Vertx threads are non-daemon and will prevent JVM exit, so always remember to callDeserializer.close()
.- Specified by:
configure
in interfacecom.solace.serdes.Deserializer<T>
- Overrides:
configure
in classAbstractDeserializer<T,com.networknt.schema.JsonSchema>
- Parameters:
properties
- A Map containing configuration properties.- See Also:
SerdeProperties
-
-