The BreweryController
calls an external API, the API of the Open Brewery Database. The connection to the external service is behaving chaotic! There is also a Chaos Monkey scrambling the result once in a while!
Use the /breweries
endpoint in swagger to test the disfunctioning API calls.
Use the /resilientbreweries
to test the same API but now with a retry policy. The result of this call will be much better!
Use the /scrambledbreweries
to test the API with a misbehaving Behaviour Chaos Monkey which will scramble the data once in a while.
Just to demonstrate some other chaos options, I added a UnstableController
. Just look into the code and test it with swagger.
The ProductController
is using a ProductService
which can be decorated with two decorators: a ChaosProductServiceDecorator
which injects chaos into the ProductService
and a ResilientProductServiceDecorator
which uses policies to handle exceptions and create a resilient product service. To enable the decorators change the appsettings.json
:
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"SimmySettings": {
"FaultPolicySettings": {
"Enabled": true,
"InjectionRate": 0.5
},
"LatencyPolicySettings": {
"Enabled": true,
"Latency": 3,
"InjectionRate": 0.5
},
"EnableProductServiceChaos": false, // <- change this to true to get a chaotic experience
"EnableResilientProductService": false // <- also change this to true to create a resilient service
}
}
Use the swagger page to request product details. If everything is working well the result will be a book and a few related books. If something goes wrong an empty list of related books will be returned.
- What is Simmy
- Simmy (Github)
- Simmy with Azure App Configuration
- Kolton Andrus on Lessons Learnt From Failure Testing at Amazon and Netflix and New Venture Gremlin, InfoQ Podcast
- Simmy and Chaos Engineering Geovanny Alzate Sandoval, Adventures In .Net Podcast
- Chaos Engineering with Charles Torre, MS Dev Show Podcast