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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
17
2
事件驱动型微服务基础
事件驱动型微服务
是被构建用于满足特定界限上下文的小型应用程序。
消费者
微服务从一
个或多个输入事件流中消费并处理事件,
生产者
微服务则往事件流中生产事件以给其他的
服务消费。事件驱动型微服务是一系列输入事件流的消费者,同时也是另外一些输出事件
流的生产者,这是很正常的。这些服务可能是无状态的(如第
5
章所
述)也可能是有状态
的(如第
7
章所述)
,并且可能包含同步的“请求
响应”
API
(如第
13
章所述)。这些服
务都共享从事件代理消费事件或往事件代理生产事件的通用功能。事件驱动型微服务之间
的通信是完全异步的。
事件流由
事件代理
提供服务,本章后半部分将对此进行详细介绍。运行任何有一定规模的
微服务通常需要使用发布流水线和容器管理系统,本章末尾会对此进行讨论。
2.1
 构建拓扑
拓扑
这个术语经常出现在事件驱动型微服务的讨论中,通常用于表示单个微服务的处理逻
辑。它也可能用于表示在独立的微服务、事件流和“请求
响应”
API
之间的类似图的关
系。下面依次看一下拓扑的各种定义。
2.1.1
 微服务拓扑
微服务拓扑是单个微服务内部的事件驱动拓扑。它定义了对传入事件执行的数据驱动操
作,包括转换、存储和发布。
2-1
展示了从两个输入事件流获取数据的单一微服务拓扑。
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