Skip to Content
Dapr学习手册
book

Dapr学习手册

by Haishi Bai, Yaron Schneider
November 2021
Beginner to intermediate
239 pages
4h 15m
Chinese
China Electric Power Press Ltd.
Content preview from Dapr学习手册
36
0
2.
Visual Studio
中,按下
Ctrl-F5
启动客户端。
程序应在打印“
Hello
World
!”字符串后停止。
3.
当前的
Go
应用期待一个带有
data
字段的
JSON
对象。但是,客户端仅
发送了一个简单的字符串。如果你希望
Go
应用能够正确显示正文,你可
以更新
/greeting
处理器直接打印出请求体,而不是尝试对其进行解码:
txt, _ := ioutil.ReadAll(r.Body)
fmt.Println(string(txt))
客户端工作到此结束。
接下来我们将转到服务端。
0.4.2
编写
gRPC
服务器
现在我们将重写
Hello World
服务来暴露
gRPC
端点而不是
HTTP
端点。为了
保持在每个示例中使用不同编程语言的习惯,这次我们将使用
Java
0.4.2.1
先决条件
要完成以下练习,你需要:
Java
开发套件(
JDK
)。
Git
客户端。
Maven
https://oreil.ly/fFCzm
)。
0.4.2.2
克隆
Dapr
存储库(如有必要)
在本例中,我们将使用
Dapr
仓库中的
Protobuf
定义。如果你还没有这么做,
请执行以下命令:
git clone https://github.com/dapr/dapr.git
0.4.2.3
创建服务器应用
以下练习使用了
Maven
命令行工具(
mvn
)。虽然诸如
Eclipse
IntelliJ
简介
37
IDE
都提供了对应的插件,但是我们认为使用命令行工具可以最清楚地了解 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

流畅的Python(第2版)

流畅的Python(第2版)

Luciano Ramalho
数据科学原理

数据科学原理

Posts & Telecom Press, Sinan Ozdemir
Python预测分析实战

Python预测分析实战

Posts & Telecom Press, Alvaro Fuentes
机器学习开发者指南

机器学习开发者指南

Posts & Telecom Press, Rodolfo Bonnin

Publisher Resources

ISBN: 9787519859367