Skip to Content
微服务与事件驱动架构
book

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
168
13
应”
API
从外部发送。虽然可以将事件代理及其流公开给外部客户端,但这样做在很大
程度上是不合理的,因为你需要解决许多与访问和安全性相关的问题。并且,“请求
应”
API
在这些场景中工作得非常出色
,就像它们在几十年前所做的一样。下面是需要考
虑的两种主要的外部生成事件类型。
13.1.1
 自动生成的事件
第一种类型的事件是通过你的产品由客户端发送给服务端
自动
产生的事件。这些请求通常
被定义为产品的度量值或测量值,比如关于用户正在做什么的信息、活动的定期测量或某
种类型的传感器读数。这些事件统称为
分析事件
,它们描述了有关产品操作的测量和事实
陈述(
3.3.4
节展示了此类事件的作用)
。安装在客户手机上的应用程序是外部事件源的极
佳例子。以
Netflix
这样的流媒体服务为例
,可以将分析事件独立地发送回服务端以衡量一
些事情,比如你已经看了哪些电影以及每部电影的观看进度。任何来自外部产品且基于源
自该产品的操作的请求,都算作外部生成的事件。
现在,你可能会有个疑问,比如,加载当前电影的下一个
60
秒内容的请求是否算作外部
生成的事件。它们当然可以算作一种事件。然而,你其实是想问:“这些事件对业务是否
足够重要,以至于它们必须进入系统事件流进行相关处理?”在许多情况下答案是“否”,
你并不需要在事件流中收集并存储这些事件。但是对于那些答案为“是”的情况,你可以
简单地将请求解析为事件并将其路由到自己的事件流中。
13.1.2
 由响应生成的事件
第二种类型的外部生成事件是
响应式
事件,它是
响应
来自某个服务的请求而生成的。你的 ...
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

监控运维实践:原则与策略

监控运维实践:原则与策略

Mike Julian
Kafka权威指南

Kafka权威指南

Neha Narkhede, Gwen Shapira, Todd Palino
Web容量规划之美

Web容量规划之美

Arun Kejariwal, John Allspaw

Publisher Resources

ISBN: 9787115571106