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

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
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
 
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
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
🐬 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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Recently uploaded (20)

Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

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