Fastjson is a Java library used to convert Java objects to their JSON representation. It can also be used to convert JSON strings to equivalent Java objects. Fastjson can handle any Java object, including pre-existing objects for which you do not have source code.
<dependencies>
<dependency>
<groupId>org.apache.dubbo.extensions</groupId>
<artifactId>dubbo-serialization-fastjson</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.83</version>
</dependency>
</dependencies>
# application.yml (Spring Boot)
dubbo:
protocol:
serialization: fastjson
or
# dubbo.properties
dubbo.protocol.serialization=fastjson
# or
dubbo.consumer.serialization=fastjson
# or
dubbo.reference.com.demo.DemoService.serialization=fastjson
or
<dubbo:protocol serialization="fastjson" />
<!-- or -->
<dubbo:consumer serialization="fastjson" />
<!-- or -->
<dubbo:reference interface="xxx" serialization="fastjson" />