Dubbo Jackson serialization instructions for use

Source: Internet
Author: User

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
    1. Serialization of generic objects, such as serialization and deserialization of list,map types, is not supported

Dubbo Jackson serialization instructions for use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.