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

微服务与事件驱动架构

by Adam Bellemare
October 2021
Beginner to intermediate
250 pages
7h 11m
Chinese
Posts & Telecom Press
Content preview from 微服务与事件驱动架构
194
14
时前移其消费者偏移量。但是,在某些情况下,必须手动调整偏移量。
应用程序重置:重置偏移量
变更微服务的逻辑可能需要你从之前的时间点重新处理事件。通常重新处理会从流的起
始点进行,但你选择的点可以根据服务的需求有所不同。
应用程序重置:前移偏移量
也许你的微服务不需要旧数据,只消费最新的数据。你可以重置应用程序偏移量到最近
的点而不是最早的那个点。
应用程序恢复:指定偏移量
你可能想把偏移量重置到特定的时间点。这通常在多集群故障转移中起作用,在这个过
程中,你想要确保没有丢失任何消息,但不希望从最开始消费事件。一种策略是将偏移
量重置为崩溃前
N
分钟的时间,以确保不会丢失任何复制的消息。
对于生产级
DevOps
,团队必须是微服务的拥有者才能修改其偏移量
,这是微服务
团队
分配系统提供的功能。
14.8
 事件流的权限和访问控制列表
对数据的访问控制不仅从业务安全的角度来看是重要的,而且也是实施单一写原则的一种
手段。权限和访问控制列表(
ACL
)确保了界限上下文可以强制限定它们的边界
。对给定
事件流的访问权限只能由拥有生产微服务的团队授予,你可以使用微服务
团队分配系统
来实施这一限制。权限通常分为以下几类(当然,这取决于事件代理的实现):读、写、
创建、删除、修改和描述。
ACL
依赖于每个消费者和生产者的个人标识。确保尽快为你的事件代理和
服务启用并强制实施标识,最好从一开始就执行。事后添加标识是非常痛苦
的,因为它需要更新和检查连接到事件代理的每个服务。
ACL
强化了界限上下文。例如,一个微服务应该只拥有对其内部事件流和变更事件流的创 ...
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