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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
用微服务构建工作流
111
难以识别特定事件的处理进度。对于事件驱动系统,监控业务核心工作流可能需要监听每
个输出事件流并将其物化到状态存储,以掌握事件无法得到处理或在处理过程中遇到困难
的情况。
例如,图
8-2
对工作流顺序的修改也意味着需要变更工作流的可视化系统,其基于这样
一个假设,即视图观察者关心工作流中的
每个
事件流,并希望了解事件的所有信息。但是
如果你并不关心工作流中的每个事件流,那么还需要对其视图做处理吗?
现在考虑一个更大规模的例子,比如大型跨国在线零售商的订单履行过程。客户查看商
品,选择要购买的商品,进行付款,然后等待发货通知。这背后可能有几十或上百个服务
在支持这个客户工作流。不同的观察者对此工作流的可视化需要会有所不同。
客户可能只关心订单从付款到履行再到发货通知的过程。你可以从这
3
个独立的事件流中
提取事件来进行适度监控。由于这个监控视图具有“公开”性质且消费的事件流数量较
少,因此其具有足够的灵活性来应对变更。但是,如果对完整的全链路工作流做可视化监
控,则需要消费数十个事件流。由于事件量以及事件流之间的独立性,要完成这个任务非
常具有挑战性,尤其是当工作流需要定期更改时。
请确保清楚知道要在工作流中进行可视化的内容。不同的观察者有不同的诉
求,并且不是工作流的所有步骤都需要暴露在视图中。
8.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

成為卓越程式設計師的38項必修法則

成為卓越程式設計師的38項必修法則

Pete Goodliffe
下一代空间计算:AR与VR创新理论与实践

下一代空间计算:AR与VR创新理论与实践

Erin Pangilinan, Steve Lukas, Vasanth Mohan

Publisher Resources

ISBN: 9787115571106