Skip to Content
构建可扩展分布式系统:方法与实践
book

构建可扩展分布式系统:方法与实践

by Ian Gorton
May 2024
Intermediate
278 pages
5h 24m
Chinese
China Machine Press
Content preview from 构建可扩展分布式系统:方法与实践
158
|
9
Spring-boot
利用其依赖注入的功能简化了舱壁的创建。可以在
application.yml
文件中
指定舱壁的配置,如下所示:
server:
tomcat:
threads:
max: 200
resilience4j.bulkhead:
instances:
OrderService:
maxConcurrentCalls: 150
maxWaitDuration: 1000ms
在代码中,你只需使用
@Bulkhead
装饰器来指定应受舱壁行为影响的方法。在以下示例
中,还指定了降级方法。该方法将在达到舱壁容量,并且请求等待超过
1 s
时调用:
@Bulkhead(name = "OrderService", fallbackMethod = “newOrderBusy”)
public OrderOutcome newOrder(OrderInfo inf){// details omitted}
扩展阅读:扩展微服务
Amazon Netflix 是微服务架构的先驱,他们在 2009 年左右大规模采用了微服务架
构。从那时起,我们学到了很多东西,当然,基于微服务构建的系统的规模也以惊
人的速度增长。为了应对现代系统的规模,Uber 已将其微服务架构发展为基于相关
服务的集合(称为域),正如这篇出色的技术博客文章(
https://oreil.ly/XXW1J
)中所
描述的。
Sam Newton 的书籍内的一个章节“ Microservices at Scale”(
https://or ...
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

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho

Publisher Resources

ISBN: 9787111750697