当前位置:网站首页>想通讯?谈钱多俗,谈ProtoBuf
想通讯?谈钱多俗,谈ProtoBuf
2022-07-16 09:46:00 【InfoQ】
什么是ProtoBuf
- 平台无关、语言无关
- 二进制、数据字描述
- 提供了完整详细的操作API
- 高性能比XML要快20-100倍
- 尺寸小比XML要小3-10倍高可扩展性
- 数据字描述前后兼容
- 语言覆盖度低,官方支持java、c++、python语言环境
- 自定义protobuf的工作量偏大
为什么是ProtoBuf
如何使用ProtoBuf
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.7.1</version>
</dependency>
<build>
<defaultGoal>package</defaultGoal>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.5.0.Final</version>
</extension>
</extensions>
<plugins>
<!-- protobuf 编译组件 -->
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<extensions>true</extensions>
<configuration>
<protoSourceRoot>${project.basedir}/src/main/proto</protoSourceRoot>
<protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.classifier}</protocArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 编译jar包的jdk版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
mvn protobuf:compile
结束语
边栏推荐
- AtCoder Beginner Contest 259 部分题解
- 高等数学---第八章隐函数偏导数与全微分
- 数据库系统原理与应用教程(020)—— 登录 MySQL
- 【今天的小go同学要去丢垃圾(1)】
- 索引的原理与设计原则
- Fosai biology interprets the changes in the atmospheric environment in the first half of 2022, and VOCs control is still the key to breaking the situation
- Huawei machine test: print task sorting
- 9. 说说hashCode() 和 equals() 之间的关系?
- [QNX Hypervisor 2.2用户手册]8.2 Guest退出
- CF514B Han Solo and Lazer Gun
猜你喜欢

How to extract value from the working capital pool by using impermanent losses

Sydtek Internship (I): 4K and ble profile burning

list map基础笔记记录

Halcon distance calculation

Renewable finance refi: providing technology and financial system beneficial to the earth

最全攻略合集!超强AI作画工具 Midjourney 开放公测!快来构建你的幻想元宇宙!...

剑指 Offer 09. 用两个栈实现队列

剑指 Offer 10- I. 斐波那契数列(4种解法)

Upgrade mysql5.5.27 to 5.7.35 under Windows Environment
聊一聊Promise
随机推荐
Zhongguancun e valley · Su Gaoxin undertakes 2022 Suzhou China Japan South Korea high-level talent project roadshow competition
The merits and demerits of cefi in the perspective of liquidity
A collection of dichotomous (dichotomous answers) questions
Selenium八大元素定位及相对定位器
NFT trading platform competition pattern: what is the core competitiveness?
HCIP - PPP/HDLC与GRE/MGRE实验
Upgrade mysql5.5.27 to 5.7.35 under Windows Environment
OneFlow源码一览:GDB编译调试
Insight into the puzzle of database, 2022 Jincang innovative product launch was held
【今天的小go同学要去丢垃圾(1)】
Atcoder beginer contest 259 partial solution
容器健康检查解析
What are the key smart contracts in defi?
数据库系统原理与应用教程(019)—— MySQL 的配置文件
Tutorial of database system principle and application (020) -- login MySQL
Talk about promise
TDSQL PG版再升级,深度参与开源生态建设
剑指 Offer 10- I. 斐波那契数列(4种解法)
Address assignment of global variables, local variables, static variables and constants
[QNX hypervisor 2.2 user manual]8.1 overhead in virtual environment