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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
134
10
基础的生产者和消费者微服务
基础的生产者和消费者(
basic producer and consumer
BPC
)微服务从一个或多个事件流
中摄取事件,应用必要的转换逻辑或业务逻辑,然后向输出事件流发出必要的事件。同步
的“请求
响应”
I/O
也可能是此工作流中的一部分
,但这个主题将在第
13
章中进行更详
细的介绍。本章会聚焦于事件驱动部分。
BPC
微服务的特征是使用了基础的消费者客户端和生产者客户端
。基础的消费者客户端不
涉及任何事件调度、水位、物化机制、变更日志或水平伸缩带本地状态存储的处理实例。
这些功能通常只属于功能更全面的框架,第
11
章和第
12
章将更深入地讨论这些框架
。虽
然你也可以开发自己的库来实现这些功能,但这远远超出了本章所要介绍的内容范围。因
此,你必须仔细考虑
BPC
模式是否能够满足业务需求。
可以使用最常用的语言来实现生产者客户端和消费者客户端,从而降低启用事件驱动型微
服务时的认知开销。一个微服务应用程序的代码包含了界限上下文的完整工作流,这使微
服务的职责更聚焦并易于理解。工作流还可以轻松地包装到一个或多个容器中(取决于实
现的复杂性),然后可以使用微服务的容器管理解决方案部署和执行这些容器。
10.1
 
BPC
的适用场合
尽管缺少全能型框架组件的大部分能力,但
BPC
微服务可以满足广泛的业务需求。
BPC
能轻松实现像无状态转换这样的简单模式,也能实现不需要确定性事件调度的有状态模式。
BPC
实现中,
外部状态存储比内部状态存储更常被使用,因为在没有采用全能型流框架
的情况下,在多实例之间伸缩本地状态和从实例故障中恢复是很困难的。外部状态存储可 ...
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