Categories: Tutorial

Chaos Engineering for Spring Boot Applications

&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">In this article&comma; we will discuss an out of box library &&num;8220&semi;<strong><em>Spring Boot Chaos Monkey<&sol;em><&sol;strong>&&num;8221&semi; to provide a Chaos Monkey for Spring Boot applications and this lib will try to check the resiliency of your running spring boot applications&period; This library is inspired by <strong><a href&equals;"https&colon;&sol;&sol;principlesofchaos&period;org&sol;" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener nofollow">PRINCIPLES OF CHAOS ENGINEERING<&sol;a><&sol;strong>&comma; with a focus on Spring Boot to test applications better during operation&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">According to the <strong>PRINCIPLES OF CHAOS ENGINEERING<&sol;strong>&&num;8211&semi;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<blockquote class&equals;"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Chaos Engineering is the discipline of experimenting on a system in order to build confidence in the system’s capability to withstand turbulent conditions in production&period;<&sol;p><&sol;blockquote>&NewLine;&NewLine;&NewLine;&NewLine;<blockquote class&equals;"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Everything from getting started to advanced usage is explained in the <a href&equals;"https&colon;&sol;&sol;codecentric&period;github&period;io&sol;chaos-monkey-spring-boot&sol;latest&sol;" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener">Documentation for Chaos Monkey for Spring Boot<&sol;a>&period;<&sol;p><&sol;blockquote>&NewLine;&NewLine;&NewLine;&NewLine;<h2 class&equals;"wp-block-heading">Need of Chaos Engineering for Spring Boot applications<&sol;h2>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">Netflix has started Chaos Engineering to check their APIs in recent years and also it contributed significantly to the growing importance of Chaos Engineering in distributed systems&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">The below lines by Fire Chief <strong>Mike Burtch<&sol;strong> but quite interesting I found&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<figure class&equals;"wp-block-pullquote"><blockquote><p>You don’t choose the moment&comma; the moment chooses you&excl;<&sol;p><p>You only choose how prepared you are when it does&period;<&sol;p><&sol;blockquote><&sol;figure>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">As application developers&comma; we focus on developing a product that must be stable&comma; secure and bug-free software&period; To achieve this&comma; we write a lot of unit tests and integration tests so that we can capture unexpected behaviour and ensure that the patterns we test do not lead to errors&period; But what I observe in my career of software development after writing many units and integration tests&comma; we might maximum achieve a code coverage from 70&percnt; to 80&percnt;&comma; sometimes more but not 100&percnt;&comma; we can&&num;8217&semi;t be happy with this unpleasant feeling&comma; how our application behaves in production&quest;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Many more questions may arise to mind such as <&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<ul class&equals;"wp-block-list"><li><em>How our code will work on the production&quest;<&sol;em><&sol;li><li><em>What will happen if one service went down&quest;<&sol;em><&sol;li><li><em>How does the application behave with network latency&quest;<&sol;em><&sol;li><li><em>Will our fallback scenarios work&quest;<&sol;em><&sol;li><li><em>Will Service Discovery work&quest;<&sol;em><&sol;li><li><em>Is our Client-Side-Load-Balancing also working&quest;<&sol;em><&sol;li><&sol;ul>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">Today&&num;8217&semi;s applications are adopting microservice architectures and distributed applications creation&period; These architectures contain many components that can’t all be fully covered with unit and integration tests&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<blockquote class&equals;"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>If you want more familiar with the principles of chaos engineering&comma; you can check out <a href&equals;"https&colon;&sol;&sol;blog&period;codecentric&period;de&sol;en&sol;2018&sol;07&sol;chaos-engineering&sol;" target&equals;"&lowbar;blank" rel&equals;"noreferrer noopener nofollow">this blog post<&sol;a> for chaos engineering&period;<&sol;p><&sol;blockquote>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Let&&num;8217&semi;s integrate Chaos Monkey for Spring Boot applications&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<h2 class&equals;"wp-block-heading">Adding Chaos Monkey in Spring Boot application<&sol;h2>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">In a spring boot application&comma; just add <em>Spring Boot Chaos Monkey<&sol;em> on your classpath of the application and activate with the profile name&comma; it will automatically hook into your spring boot application&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Add Chaos Monkey for Spring Boot as a dependency for your project using MAVEN&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lt&semi;dependency&gt&semi;&NewLine;&NewLine; &lt&semi;groupId&gt&semi;de&period;codecentric&lt&semi;&sol;groupId&gt&semi;&NewLine;&NewLine; &lt&semi;artifactId&gt&semi;chaos-monkey-spring-boot&lt&semi;&sol;artifactId&gt&semi;&NewLine;&NewLine; &lt&semi;version&gt&semi;2&period;5&period;4&lt&semi;&sol;version&gt&semi;&NewLine;&NewLine;&lt&semi;&sol;dependency&gt&semi;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><meta charset&equals;"utf-8">Add Chaos Monkey for Spring Boot as a dependency for your project using GRADLE&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>implementation 'de&period;codecentric&colon;chaos-monkey-spring-boot&colon;2&period;5&period;4'<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">Let start your Spring Boot Application with the <code>chaos-monkey<&sol;code> spring profile enabled&period; You can also pass some other properties to assault services with latency&period; Let&&num;8217&semi;s see the following properties as I have defined run time as java arguments&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>java -jar my-springboot-app&period;jar --spring&period;profiles&period;active&equals;chaos-monkey --chaos&period;monkey&period;enabled&equals;true --chaos&period;monkey&period;watcher&period;service&equals;true --chaos&period;monkey&period;assaults&period;latencyActive&equals;true<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">You can also specify the above properties in your <code>application&period;properties<&sol;code> or <code>application&period;yml<&sol;code> file&period; Let&&num;8217&semi;s see the following <code>application&period;properties<&sol;code> file with the minimum required configuration for the Chaos Monkey for Spring Boot application&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">File <code>application&period;properties<&sol;code><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>spring&period;profiles&period;active&equals;chaos-monkey&NewLine;&NewLine;chaos&period;monkey&period;enabled&equals;true&NewLine;&NewLine; &NewLine;&NewLine;chaos&period;monkey&period;watcher&period;service&equals;true&NewLine;&NewLine;chaos&period;monkey&period;assaults&period;latencyActive&equals;true<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">File <code>application&period;yml<&sol;code><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>spring&colon;&NewLine;&NewLine; profiles&colon;&NewLine;&NewLine; active&colon; chaos-monkey&NewLine;&NewLine;chaos&colon;&NewLine;&NewLine; monkey&colon;&NewLine;&NewLine; enabled&colon; true&NewLine;&NewLine; watcher&colon;&NewLine;&NewLine; service&colon; true&NewLine;&NewLine; assaults&colon;&NewLine;&NewLine; latencyActive&colon; true<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">Now you can activate watchers&comma; which look for classes to assault&period; There are also runtime assaults&comma; which attack your whole application&period; Let&&num;8217&semi;s see the following diagram how does it work&quest;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<div class&equals;"wp-block-image is-style-rounded"><figure class&equals;"aligncenter size-large"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2022&sol;01&sol;chaos-engineering-with-spring-boot-application-1024x426&period;png" class&equals;"wp-image-4580"&sol;><figcaption>&commat;Image Source-codecentric&period;github&period;com <&sol;figcaption><&sol;figure><&sol;div>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">In the above diagram&comma; we can see that Chaos Monkey provides watchers and assaults&period; In the Spring boot applications&comma; we have controllers&comma; repositories&comma; and services and Spring Boot Chaos Monkey has a corresponding watcher for each resource&period; For example&comma; &commat;Controller watched by controller watcher&comma; &commat;Respository watched by repository watchers etc&period; And each watcher can generate multiple assaults for each resource&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<h3 class&equals;"wp-block-heading">Watcher<&sol;h3>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">A watcher is a Chaos Monkey for Spring Boot component&comma; that will scan your app for beans based on one of the conditions described in Watcher Types&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">These watchers find your beans based on the following annotations&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<ul class&equals;"wp-block-list"><li>&commat;Controller<&sol;li><li>&commat;RestController<&sol;li><li>&commat;Service<&sol;li><li>&commat;Repository<&sol;li><li>&commat;Component<&sol;li><&sol;ul>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">We can also define custom watchers as well&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<h3 class&equals;"wp-block-heading">Assault<&sol;h3>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Assaults are the heart of Monkey’s Chaos and he makes use of them based on your configuration&period; There are the following types of assault provided by Chaos Monkey&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>Request Assaults<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">These assaults attack some point of your application and are triggered by a <strong>&sol;actuator&sol;chaosmonkey&sol;watchers<&sol;strong> endpoint&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<ul class&equals;"wp-block-list"><li>Latency Assault <&sol;li><li>Exception Assault<&sol;li><&sol;ul>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>Runtime Assaults<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<ul class&equals;"wp-block-list"><li>AppKiller Assault<&sol;li><li>Memory Assault<&sol;li><li>CPU Assault<&sol;li><&sol;ul>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">The above minimum configuration is enough to test your spring boot application resiliency but if you pass these properties by using the configuration files either using <code>application&period;properties<&sol;code> or <code>application&period;yml<&sol;code> file&comma; you have to start your application on production&period; Starting the production application to test your resiliency is not recommended way you have to take a lot of approval from upper management&comma; so you can avoid this restart if you use the Spring Boot Actuator and HTTP&sol;JMX&period; <&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<h3 class&equals;"wp-block-heading">Spring Boot Actuator Endpoints<&sol;h3>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"has-text-align-justify wp-block-paragraph">Chaos Monkey for Spring Boot offers you some built-in endpoints exposed via JMX or HTTP&period; This allows you to change the configuration at runtime&period;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><meta charset&equals;"utf-8">File <code>application&period;properties<&sol;code><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>management&period;endpoint&period;chaosmonkey&period;enabled&equals;true&NewLine;&NewLine;management&period;endpoint&period;chaosmonkeyjmx&period;enabled&equals;true&NewLine;&NewLine; &NewLine;&NewLine;&num; include all endpoints&NewLine;&NewLine;management&period;endpoints&period;web&period;exposure&period;include&equals;&ast;&NewLine;&NewLine; &NewLine;&NewLine;&num; include specific endpoints&NewLine;&NewLine;management&period;endpoints&period;web&period;exposure&period;include&equals;health&comma;info&comma;chaosmonkey<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><meta charset&equals;"utf-8">File <code>application&period;yml<&sol;code><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>management&colon;&NewLine;&NewLine; endpoint&colon;&NewLine;&NewLine; chaosmonkey&colon;&NewLine;&NewLine; enabled&colon; true&NewLine;&NewLine; chaosmonkeyjmx&colon;&NewLine;&NewLine; enabled&colon; true&NewLine;&NewLine; &NewLine;&NewLine; endpoints&colon;&NewLine;&NewLine; web&colon;&NewLine;&NewLine; exposure&colon;&NewLine;&NewLine; &num; include all endpoints&NewLine;&NewLine; include&colon; "&ast;"&NewLine;&NewLine; &num; include specific endpoints&NewLine;&NewLine; include&colon;&NewLine;&NewLine; - health&NewLine;&NewLine; - info&NewLine;&NewLine; - chaosmonkey<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Let&&num;8217&semi;s start the Spring Boot application test all endpoints as below&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Chaos Monkey Configuration<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">&sol;<strong><em>actuator&sol;chaosmonkey<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "chaosMonkeyProperties"&colon; &lbrace;&NewLine; "enabled"&colon; true&comma;&NewLine; "togglePrefix"&colon; "chaos&period;monkey"&NewLine; &rcub;&comma;&NewLine; "assaultProperties"&colon; &lbrace;&NewLine; "level"&colon; 1&comma;&NewLine; "deterministic"&colon; false&comma;&NewLine; "latencyRangeStart"&colon; 1000&comma;&NewLine; "latencyRangeEnd"&colon; 3000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; false&comma;&NewLine; "exception"&colon; &lbrace;&NewLine; "type"&colon; null&comma;&NewLine; "arguments"&colon; null&NewLine; &rcub;&comma;&NewLine; "killApplicationActive"&colon; false&comma;&NewLine; "memoryActive"&colon; false&comma;&NewLine; "memoryMillisecondsHoldFilledMemory"&colon; 90000&comma;&NewLine; "memoryMillisecondsWaitNextIncrease"&colon; 1000&comma;&NewLine; "memoryFillIncrementFraction"&colon; 0&period;15&comma;&NewLine; "memoryFillTargetFraction"&colon; 0&period;25&comma;&NewLine; "cpuActive"&colon; false&comma;&NewLine; "cpuMillisecondsHoldLoad"&colon; 90000&comma;&NewLine; "cpuLoadTargetFraction"&colon; 0&period;9&comma;&NewLine; "runtimeAssaultCronExpression"&colon; "OFF"&NewLine; &rcub;&comma;&NewLine; "watcherProperties"&colon; &lbrace;&NewLine; "controller"&colon; false&comma;&NewLine; "restController"&colon; false&comma;&NewLine; "service"&colon; true&comma;&NewLine; "repository"&colon; false&comma;&NewLine; "component"&colon; false&comma;&NewLine; "restTemplate"&colon; false&comma;&NewLine; "webClient"&colon; false&comma;&NewLine; "actuatorHealth"&colon; false&comma;&NewLine; "beans"&colon; &&num;91&semi;&rsqb;&NewLine; &rcub;&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Chaos Monkey Status<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong><em>&sol;actuator&sol;chaosmonkey&sol;status<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>Ready to be evil&excl;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>POST Chaos Monkey disable<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong><em>&sol;actuator&sol;chaosmonkey&sol;disable<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "status"&colon; "Chaos Monkey is disabled"&comma;&NewLine; "disabledAt"&colon; "2022-01-04T16&colon;41&colon;40&period;426&plus;05&colon;30"&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>POST Chaos Monkey enable<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong><em>&sol;actuator&sol;chaosmonkey&sol;enable<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "status"&colon; "Chaos Monkey is enabled"&comma;&NewLine; "enabledAt"&colon; "2022-01-04T16&colon;44&colon;35&period;909&plus;05&colon;30"&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Watchers<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>&sol;actuator&sol;chaosmonkey&sol;watchers<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "controller"&colon; false&comma;&NewLine; "restController"&colon; false&comma;&NewLine; "service"&colon; true&comma;&NewLine; "repository"&colon; false&comma;&NewLine; "component"&colon; false&comma;&NewLine; "restTemplate"&colon; false&comma;&NewLine; "webClient"&colon; false&comma;&NewLine; "actuatorHealth"&colon; false&comma;&NewLine; "beans"&colon; &&num;91&semi;&rsqb;&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>POST Watchers<&sol;strong><br>Request to enable&sol;disable Watchers<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">POST<strong><em> &sol;actuator&sol;chaosmonkey&sol;watchers<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Request Body&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "controller"&colon; true&comma;&NewLine; "restController"&colon; true&comma;&NewLine; "service"&colon; true&comma;&NewLine; "repository"&colon; true&comma;&NewLine; "component"&colon; false&comma;&NewLine; "restTemplate"&colon; false&comma;&NewLine; "webClient"&colon; false&comma;&NewLine; "actuatorHealth"&colon; false&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>Watcher config has changed<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Check again watchers<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Watchers<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>&sol;actuator&sol;chaosmonkey&sol;watchers<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "controller"&colon; true&comma;&NewLine; "restController"&colon; true&comma;&NewLine; "service"&colon; true&comma;&NewLine; "repository"&colon; true&comma;&NewLine; "component"&colon; false&comma;&NewLine; "restTemplate"&colon; false&comma;&NewLine; "webClient"&colon; false&comma;&NewLine; "actuatorHealth"&colon; false&comma;&NewLine; "beans"&colon; &&num;91&semi;&rsqb;&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Assaults<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><em>GET &sol;actuator&sol;chaosmonkey&sol;assaults<&sol;em><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "level"&colon; 1&comma;&NewLine; "deterministic"&colon; false&comma;&NewLine; "latencyRangeStart"&colon; 1000&comma;&NewLine; "latencyRangeEnd"&colon; 3000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; false&comma;&NewLine; "exception"&colon; &lbrace;&NewLine; "type"&colon; null&comma;&NewLine; "arguments"&colon; null&NewLine; &rcub;&comma;&NewLine; "killApplicationActive"&colon; false&comma;&NewLine; "memoryActive"&colon; false&comma;&NewLine; "memoryMillisecondsHoldFilledMemory"&colon; 90000&comma;&NewLine; "memoryMillisecondsWaitNextIncrease"&colon; 1000&comma;&NewLine; "memoryFillIncrementFraction"&colon; 0&period;15&comma;&NewLine; "memoryFillTargetFraction"&colon; 0&period;25&comma;&NewLine; "cpuActive"&colon; false&comma;&NewLine; "cpuMillisecondsHoldLoad"&colon; 90000&comma;&NewLine; "cpuLoadTargetFraction"&colon; 0&period;9&comma;&NewLine; "runtimeAssaultCronExpression"&colon; "OFF"&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>POST Assaults<&sol;strong><br>Request to enable Latency &amp&semi; Exception Assault<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">POST <strong><em>&sol;actuator&sol;chaosmonkey&sol;assaults<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Request Body&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "level"&colon; 5&comma;&NewLine; "latencyRangeStart"&colon; 2000&comma;&NewLine; "latencyRangeEnd"&colon; 5000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; true&comma;&NewLine; "killApplicationActive"&colon; false&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>Assault config has changed<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>GET Assaults again<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><em>GET &sol;actuator&sol;chaosmonkey&sol;assaults<&sol;em><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "level"&colon; 5&comma;&NewLine; "deterministic"&colon; false&comma;&NewLine; "latencyRangeStart"&colon; 2000&comma;&NewLine; "latencyRangeEnd"&colon; 5000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; true&comma;&NewLine; "exception"&colon; &lbrace;&NewLine; "type"&colon; null&comma;&NewLine; "arguments"&colon; null&NewLine; &rcub;&comma;&NewLine; "killApplicationActive"&colon; false&comma;&NewLine; "memoryActive"&colon; false&comma;&NewLine; "memoryMillisecondsHoldFilledMemory"&colon; 90000&comma;&NewLine; "memoryMillisecondsWaitNextIncrease"&colon; 1000&comma;&NewLine; "memoryFillIncrementFraction"&colon; 0&period;15&comma;&NewLine; "memoryFillTargetFraction"&colon; 0&period;25&comma;&NewLine; "cpuActive"&colon; false&comma;&NewLine; "cpuMillisecondsHoldLoad"&colon; 90000&comma;&NewLine; "cpuLoadTargetFraction"&colon; 0&period;9&comma;&NewLine; "runtimeAssaultCronExpression"&colon; "OFF"&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><strong>Define specific method attacks<&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">POST <strong><em>&sol;actuator&sol;chaosmonkey&sol;assaults<&sol;em><&sol;strong><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Request Body&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "level"&colon; 5&comma;&NewLine; "latencyRangeStart"&colon; 2000&comma;&NewLine; "latencyRangeEnd"&colon; 5000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; true&comma;&NewLine; "killApplicationActive"&colon; false&comma;&NewLine; "watchedCustomServices"&colon; &&num;91&semi;&NewLine; "com&period;doj&period;myapp&period;controller&period;HelloController&period;sayHello"&comma;&NewLine; "com&period;doj&period;myapp&period;controller&period;HelloController&period;sayWelcome"&NewLine; &rsqb;&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph">Response&colon;<&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>Assault config has changed<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><meta charset&equals;"utf-8"> <p><strong>GET Assaults again<&sol;strong><&sol;p><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><p><em>GET &sol;actuator&sol;chaosmonkey&sol;assaults<&sol;em><&sol;p><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"><p>Response&colon;<&sol;p><&sol;p>&NewLine;&NewLine;&NewLine;&NewLine;<pre class&equals;"wp-block-code"><code>&lbrace;&NewLine; "level"&colon; 5&comma;&NewLine; "deterministic"&colon; false&comma;&NewLine; "latencyRangeStart"&colon; 2000&comma;&NewLine; "latencyRangeEnd"&colon; 5000&comma;&NewLine; "latencyActive"&colon; true&comma;&NewLine; "exceptionsActive"&colon; true&comma;&NewLine; "exception"&colon; &lbrace;&NewLine; "type"&colon; null&comma;&NewLine; "arguments"&colon; null&NewLine; &rcub;&comma;&NewLine; "killApplicationActive"&colon; false&comma;&NewLine; "memoryActive"&colon; false&comma;&NewLine; "memoryMillisecondsHoldFilledMemory"&colon; 90000&comma;&NewLine; "memoryMillisecondsWaitNextIncrease"&colon; 1000&comma;&NewLine; "memoryFillIncrementFraction"&colon; 0&period;15&comma;&NewLine; "memoryFillTargetFraction"&colon; 0&period;25&comma;&NewLine; "cpuActive"&colon; false&comma;&NewLine; "cpuMillisecondsHoldLoad"&colon; 90000&comma;&NewLine; "cpuLoadTargetFraction"&colon; 0&period;9&comma;&NewLine; "runtimeAssaultCronExpression"&colon; "OFF"&comma;&NewLine; "watchedCustomServices"&colon; &&num;91&semi;&NewLine; "com&period;doj&period;myapp&period;controller&period;HelloController&period;sayHello"&comma;&NewLine; "com&period;doj&period;myapp&period;controller&period;HelloController&period;sayWelcome"&NewLine; &rsqb;&NewLine;&rcub;<&sol;code><&sol;pre>&NewLine;&NewLine;&NewLine;&NewLine;<p class&equals;"wp-block-paragraph"> <&sol;p>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;spring-batch-read-from-csv-and-write-to-relational-db&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;top-20-mongodb-interview-questions-2022&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '4579'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago