《Apache Dubbo微服务开发从入门到精通》——通信协议——二、 HTTP/2(Triple)协议(3) https://developer.aliyun.com/article/1224946
4) Triple 协议基本使用方式
a) 使用 Protobuf 定义服务
• 编写 IDL 文件

• 添加编译 protobuf 的 extension 和 plugin(以 maven 为例)
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.1</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.6.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.7.1:exe:${os.detected.
classifier}</protocArtifact>
<pluginId>triple-java</pluginId>
<outputDirectory>build/generated/source/proto/main/java</outputDire
ctory>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
• 构建/编译生成 protobuf Message 类

b) Unary 方式
• 编写 Java 接口

• 创建 Provider

• 创建 Consumer

• 运行 Provider 和 Consumer,可以看到请求正常返回

《Apache Dubbo微服务开发从入门到精通》——通信协议——二、 HTTP/2(Triple)协议(5) https://developer.aliyun.com/article/1224943