SlideShare a Scribd company logo
1 of 41
Download to read offline
Resilient
Applications
with Circuit Breakers
failure• n. (pl. failures)
1 inability of a system or component to perform its required
functions within specified performance requirements
Extracted from Netflix’s Github
Dependencies
Extracted from Netflix’s Github
Dependencies
Extracted from Netflix’s Github
Dependencies
Error propagation
Embrace failure
● Faults will occur
● Faults are tolerable
“We should write software that is cynical and expects
bad things to happen” - Michael T. Nygard
1 an automatic device for stopping the flow of a
current in an electric circuit as a safety measure
circuit-breaker • n. (pl. circuit-breakers)
Resilience
● Fail fast
Resilience
● Fail fast
● Rapidly recover
The Pattern
Netflix Hystrix
How it works
● Wrap calls
● Thread pool
● Timeout
● Measuring
● Fallback
The Code
class SleepCommand extends HystrixCommand<String> {
SleepCommand() {
super(
withGroupKey('sleep-group').
andCommandPropertiesDefaults(
withCircuitBreakerSleepWindowInMilliseconds(wait).
withExecutionTimeoutInMilliseconds(timeout)
)
)
}
...
class SleepCommand extends HystrixCommand<String> {
SleepCommand() {
super(
withGroupKey('sleep-group').
andCommandPropertiesDefaults(
withCircuitBreakerSleepWindowInMilliseconds(wait).
withExecutionTimeoutInMilliseconds(timeout)
)
)
}
...
class SleepCommand extends HystrixCommand<String> {
SleepCommand() {
super(
withGroupKey('sleep-group').
andCommandPropertiesDefaults(
withCircuitBreakerSleepWindowInMilliseconds(wait).
withExecutionTimeoutInMilliseconds(timeout)
)
)
}
...
class SleepCommand extends HystrixCommand<String> {
SleepCommand() {
super(
withGroupKey('sleep-group').
andCommandPropertiesDefaults(
withCircuitBreakerSleepWindowInMilliseconds(wait).
withExecutionTimeoutInMilliseconds(timeout)
)
)
}
...
class SleepCommand extends HystrixCommand<String> {
SleepCommand() {
super(
withGroupKey('sleep-group').
andCommandPropertiesDefaults(
withCircuitBreakerSleepWindowInMilliseconds(wait).
withExecutionTimeoutInMilliseconds(timeout)
)
)
}
...
static final Integer timeout = 100
@Override
String run() throws Exception {
def time = Math.abs random.nextInt(150)
Thread.sleep time
"Sleeped for ${time} miliseconds"
}
@Override
String getFallback() {
"Didn't sleep at all"
}
static final Integer timeout = 100
@Override
String run() throws Exception {
def time = Math.abs random.nextInt(150)
Thread.sleep time
"Sleeped for ${time} miliseconds"
}
@Override
String getFallback() {
"Didn't sleep at all"
}
static final Integer timeout = 100
@Override
String run() throws Exception {
def time = Math.abs random.nextInt(150)
Thread.sleep time
"Sleeped for ${time} miliseconds"
}
@Override
String getFallback() {
"Didn't sleep at all"
}
static final Integer timeout = 100
@Override
String run() throws Exception {
def time = Math.abs random.nextInt(150)
Thread.sleep time
"Sleeped for ${time} miliseconds"
}
@Override
String getFallback() {
"Didn't sleep at all"
}
References
References
References
References
References
References
Release It, Design and Deploy Production-ready Software, Michael T. Nygard
https://pragprog.com/book/mnee/release-it
Application Resilience Engineering at Netflix, Ben Christensen
https://www.youtube.com/watch?v=RzlluokGi1w
Operational Excellence with Netflix Hystrix, Billy Yuen
https://www.youtube.com/watch?v=VuCYkY7pFk8
Making Netflix more resilient, Ben Schmaus
http://techblog.netflix.com/2011/12/making-netflix-api-more-resilient.html
Hystrix, Defend Your App, Netflix Github
https://github.com/Netflix/Hystrix/wiki/How-it-Works
Josué Neis
jneis josueneis josueneis

More Related Content

Similar to Resilient Applications with Circuit Breakers

Building ‘Bootiful’ microservices cloud
Building ‘Bootiful’ microservices cloudBuilding ‘Bootiful’ microservices cloud
Building ‘Bootiful’ microservices cloudIdan Fridman
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time SystemsDeepak John
 
Highly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemHighly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemJames Gan
 
2015 05-07 - vu amsterdam - testing safety critical systems
2015 05-07 - vu amsterdam - testing safety critical systems2015 05-07 - vu amsterdam - testing safety critical systems
2015 05-07 - vu amsterdam - testing safety critical systemsJaap van Ekris
 
Testing Safety Critical Systems (10-02-2014, VU amsterdam)
Testing Safety Critical Systems (10-02-2014, VU amsterdam)Testing Safety Critical Systems (10-02-2014, VU amsterdam)
Testing Safety Critical Systems (10-02-2014, VU amsterdam)Jaap van Ekris
 
Multi core programming 2
Multi core programming 2Multi core programming 2
Multi core programming 2Robin Aggarwal
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPLnitinscribd
 
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)Jaap van Ekris
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDocker, Inc.
 
Design patterns - Common Solutions to Common Problems - Brad Wood
Design patterns -  Common Solutions to Common Problems - Brad WoodDesign patterns -  Common Solutions to Common Problems - Brad Wood
Design patterns - Common Solutions to Common Problems - Brad WoodOrtus Solutions, Corp
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with MicronautQAware GmbH
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKsrelayr
 
Normalizing Empire's Traffic to Evade Anomaly-Based IDS
Normalizing Empire's Traffic to Evade Anomaly-Based IDSNormalizing Empire's Traffic to Evade Anomaly-Based IDS
Normalizing Empire's Traffic to Evade Anomaly-Based IDSUtku Sen
 
Impatience is a Virtue: Revisiting Disorder in High-Performance Log Analytics
Impatience is a Virtue: Revisiting Disorder in High-Performance Log AnalyticsImpatience is a Virtue: Revisiting Disorder in High-Performance Log Analytics
Impatience is a Virtue: Revisiting Disorder in High-Performance Log AnalyticsBadrish Chandramouli
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Martin Spier
 

Similar to Resilient Applications with Circuit Breakers (20)

Building ‘Bootiful’ microservices cloud
Building ‘Bootiful’ microservices cloudBuilding ‘Bootiful’ microservices cloud
Building ‘Bootiful’ microservices cloud
 
Resilience engineering
Resilience engineeringResilience engineering
Resilience engineering
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
Highly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core SystemHighly Scalable Java Programming for Multi-Core System
Highly Scalable Java Programming for Multi-Core System
 
Realtime
RealtimeRealtime
Realtime
 
2015 05-07 - vu amsterdam - testing safety critical systems
2015 05-07 - vu amsterdam - testing safety critical systems2015 05-07 - vu amsterdam - testing safety critical systems
2015 05-07 - vu amsterdam - testing safety critical systems
 
Testing Safety Critical Systems (10-02-2014, VU amsterdam)
Testing Safety Critical Systems (10-02-2014, VU amsterdam)Testing Safety Critical Systems (10-02-2014, VU amsterdam)
Testing Safety Critical Systems (10-02-2014, VU amsterdam)
 
Multi core programming 2
Multi core programming 2Multi core programming 2
Multi core programming 2
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
Værktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmerVærktøjer udviklet på AAU til analyse af SCJ programmer
Værktøjer udviklet på AAU til analyse af SCJ programmer
 
how-to-bypass-AM-PPL
how-to-bypass-AM-PPLhow-to-bypass-AM-PPL
how-to-bypass-AM-PPL
 
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
Testing safety critical systems: Practice and Theory (14-05-2013, VU Amsterdam)
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at Netflix
 
Design patterns - Common Solutions to Common Problems - Brad Wood
Design patterns -  Common Solutions to Common Problems - Brad WoodDesign patterns -  Common Solutions to Common Problems - Brad Wood
Design patterns - Common Solutions to Common Problems - Brad Wood
 
Microservices with Micronaut
Microservices with MicronautMicroservices with Micronaut
Microservices with Micronaut
 
Building Top-Notch Androids SDKs
Building Top-Notch Androids SDKsBuilding Top-Notch Androids SDKs
Building Top-Notch Androids SDKs
 
Normalizing Empire's Traffic to Evade Anomaly-Based IDS
Normalizing Empire's Traffic to Evade Anomaly-Based IDSNormalizing Empire's Traffic to Evade Anomaly-Based IDS
Normalizing Empire's Traffic to Evade Anomaly-Based IDS
 
Impatience is a Virtue: Revisiting Disorder in High-Performance Log Analytics
Impatience is a Virtue: Revisiting Disorder in High-Performance Log AnalyticsImpatience is a Virtue: Revisiting Disorder in High-Performance Log Analytics
Impatience is a Virtue: Revisiting Disorder in High-Performance Log Analytics
 
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)Ensuring Performance in a Fast-Paced Environment (CMG 2014)
Ensuring Performance in a Fast-Paced Environment (CMG 2014)
 
Real time systems
Real time systemsReal time systems
Real time systems
 

Recently uploaded

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Recently uploaded (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Resilient Applications with Circuit Breakers

  • 2. failure• n. (pl. failures) 1 inability of a system or component to perform its required functions within specified performance requirements
  • 3. Extracted from Netflix’s Github Dependencies
  • 4. Extracted from Netflix’s Github Dependencies
  • 5. Extracted from Netflix’s Github Dependencies
  • 6.
  • 8. Embrace failure ● Faults will occur ● Faults are tolerable “We should write software that is cynical and expects bad things to happen” - Michael T. Nygard
  • 9. 1 an automatic device for stopping the flow of a current in an electric circuit as a safety measure circuit-breaker • n. (pl. circuit-breakers)
  • 11. Resilience ● Fail fast ● Rapidly recover
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 23. How it works ● Wrap calls ● Thread pool ● Timeout ● Measuring ● Fallback
  • 25. class SleepCommand extends HystrixCommand<String> { SleepCommand() { super( withGroupKey('sleep-group'). andCommandPropertiesDefaults( withCircuitBreakerSleepWindowInMilliseconds(wait). withExecutionTimeoutInMilliseconds(timeout) ) ) } ...
  • 26. class SleepCommand extends HystrixCommand<String> { SleepCommand() { super( withGroupKey('sleep-group'). andCommandPropertiesDefaults( withCircuitBreakerSleepWindowInMilliseconds(wait). withExecutionTimeoutInMilliseconds(timeout) ) ) } ...
  • 27. class SleepCommand extends HystrixCommand<String> { SleepCommand() { super( withGroupKey('sleep-group'). andCommandPropertiesDefaults( withCircuitBreakerSleepWindowInMilliseconds(wait). withExecutionTimeoutInMilliseconds(timeout) ) ) } ...
  • 28. class SleepCommand extends HystrixCommand<String> { SleepCommand() { super( withGroupKey('sleep-group'). andCommandPropertiesDefaults( withCircuitBreakerSleepWindowInMilliseconds(wait). withExecutionTimeoutInMilliseconds(timeout) ) ) } ...
  • 29. class SleepCommand extends HystrixCommand<String> { SleepCommand() { super( withGroupKey('sleep-group'). andCommandPropertiesDefaults( withCircuitBreakerSleepWindowInMilliseconds(wait). withExecutionTimeoutInMilliseconds(timeout) ) ) } ...
  • 30. static final Integer timeout = 100 @Override String run() throws Exception { def time = Math.abs random.nextInt(150) Thread.sleep time "Sleeped for ${time} miliseconds" } @Override String getFallback() { "Didn't sleep at all" }
  • 31. static final Integer timeout = 100 @Override String run() throws Exception { def time = Math.abs random.nextInt(150) Thread.sleep time "Sleeped for ${time} miliseconds" } @Override String getFallback() { "Didn't sleep at all" }
  • 32. static final Integer timeout = 100 @Override String run() throws Exception { def time = Math.abs random.nextInt(150) Thread.sleep time "Sleeped for ${time} miliseconds" } @Override String getFallback() { "Didn't sleep at all" }
  • 33. static final Integer timeout = 100 @Override String run() throws Exception { def time = Math.abs random.nextInt(150) Thread.sleep time "Sleeped for ${time} miliseconds" } @Override String getFallback() { "Didn't sleep at all" }
  • 34.
  • 40. References Release It, Design and Deploy Production-ready Software, Michael T. Nygard https://pragprog.com/book/mnee/release-it Application Resilience Engineering at Netflix, Ben Christensen https://www.youtube.com/watch?v=RzlluokGi1w Operational Excellence with Netflix Hystrix, Billy Yuen https://www.youtube.com/watch?v=VuCYkY7pFk8 Making Netflix more resilient, Ben Schmaus http://techblog.netflix.com/2011/12/making-netflix-api-more-resilient.html Hystrix, Defend Your App, Netflix Github https://github.com/Netflix/Hystrix/wiki/How-it-Works