MessagePack

This article introduces MessagePack serialization

1 Introduction

MessagePack is a computer data interchange format. It is a binary format used to represent simple data structures such as arrays and associative arrays. MessagePack is designed to be as compact and simple as possible.

2 How to Use

2.1 Adding Dependencies

  1. <dependencies>
  2. <dependency>
  3. <groupId>org.apache.dubbo.extensions</groupId>
  4. <artifactId>dubbo-serialization-msgpack</artifactId>
  5. <version>3.3.0</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>org.msgpack</groupId>
  9. <artifactId>msgpack-core</artifactId>
  10. <version>0.9.3</version>
  11. </dependency>
  12. <dependency>
  13. <groupId>org.msgpack</groupId>
  14. <artifactId>jackson-dataformat-msgpack</artifactId>
  15. <version>0.9.3</version>
  16. </dependency>
  17. </dependencies>

2.2 Configuration Enable

  1. # application.yml (Spring Boot)
  2. dubbo:
  3. protocol:
  4. serialization: msgpack

or

  1. # dubbo.properties
  2. dubbo.protocol.serialization=msgpack
  3. # or
  4. dubbo.consumer.serialization=msgpack
  5. # or
  6. dubbo.reference.com.demo.DemoService.serialization=msgpack

or

  1. <dubbo:protocol serialization="msgpack" />
  2. <!-- or -->
  3. <dubbo:consumer serialization="msgpack" />
  4. <!-- or -->
  5. <dubbo:reference interface="xxx" serialization="msgpack" />

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)