Jackson serialization provides support for the serialization of basic data types and simple beans, as well as for class inheritance.
The data types that have been tested include:
Boolean/booleanLong/longInteger/intDouble/doubleShort/shortFloat/floatByte/bytejava.util.Dateorg.joda.time.DateTime
and arrays and beans consisting of these basic data types, such as int[], string[], and so on.
Jackson serialization using
<Dubbo:name="Dubboport=" 20880serialization="Jackson"/>
Custom Objectmapper
By default, the Objectmapper definition used by Jackson for serialization and deserialization is as follows:
@override public objectmapper getObjectMapper () {objectmapper objectmapper = new O Bjectmapper (); Objectmapper.disable (serializationfeature //objectmapper.disable (serializationfeature.flush_after_write_value); objectMapper .disable (deserializationfeature . Fail_on_unknown_properties); Objectmapper.settimezone (timezone.getDefault ()); Span class= "pl-k" >return objectmapper;
If you need a custom jacksonobjectmapperprovider, Developers can customize by implementing the Com.alibaba.dubbo.common.json.JacksonObjectMapperProvider interface and add files to the/meta-inf/dubbo/ Com.alibaba.dubbo.common.json.JacksonObjectMapperProvider, examples of the content are as follows:
jackson=com.alibaba.dubbo.examples.jackson.jacksonprovider.CustomJacksonObjectMapperProvider
Known Issues
- Serialization of generic objects, such as serialization and deserialization of list,map types, is not supported
Dubbo Jackson serialization instructions for use