MessagePack是一种计算机数据交换格式。它是一种二进制形式,用于表示简单的数据结构,如数组和关联数组。MessagePack 旨在尽可能紧凑和简单。
<dependencies>
<dependency>
<groupId>org.apache.dubbo.extensions</groupId>
<artifactId>dubbo-serialization-msgpack</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.msgpack</groupId>
<artifactId>msgpack-core</artifactId>
<version>0.9.3</version>
</dependency>
<dependency>
<groupId>org.msgpack</groupId>
<artifactId>jackson-dataformat-msgpack</artifactId>
<version>0.9.3</version>
</dependency>
</dependencies>
# application.yml (Spring Boot)
dubbo:
protocol:
serialization: msgpack
或
# dubbo.properties
dubbo.protocol.serialization=msgpack
# or
dubbo.consumer.serialization=msgpack
# or
dubbo.reference.com.demo.DemoService.serialization=msgpack
或
<dubbo:protocol serialization="msgpack" />
<!-- or -->
<dubbo:consumer serialization="msgpack" />
<!-- or -->
<dubbo:reference interface="xxx" serialization="msgpack" />