BAEL-2039: chaos monkey for spring boot (#4889)
This commit is contained in:
parent
e7485a1813
commit
e80c93b72b
|
@ -149,6 +149,12 @@
|
||||||
<artifactId>rome</artifactId>
|
<artifactId>rome</artifactId>
|
||||||
<version>${rome.version}</version>
|
<version>${rome.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>de.codecentric</groupId>
|
||||||
|
<artifactId>chaos-monkey-spring-boot</artifactId>
|
||||||
|
<version>${chaos.monkey.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -219,6 +225,7 @@
|
||||||
<tomee-servlet-api.version>8.5.11</tomee-servlet-api.version>
|
<tomee-servlet-api.version>8.5.11</tomee-servlet-api.version>
|
||||||
<togglz.version>2.4.1.Final</togglz.version>
|
<togglz.version>2.4.1.Final</togglz.version>
|
||||||
<rome.version>1.9.0</rome.version>
|
<rome.version>1.9.0</rome.version>
|
||||||
|
<chaos.monkey.version>2.0.0</chaos.monkey.version>
|
||||||
<graphql-spring-boot-starter.version>3.6.0</graphql-spring-boot-starter.version>
|
<graphql-spring-boot-starter.version>3.6.0</graphql-spring-boot-starter.version>
|
||||||
<graphql-java-tools.version>3.2.0</graphql-java-tools.version>
|
<graphql-java-tools.version>3.2.0</graphql-java-tools.version>
|
||||||
<guava.version>18.0</guava.version>
|
<guava.version>18.0</guava.version>
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.baeldung.chaosmonkey;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by adi on 8/2/18.
|
||||||
|
*/
|
||||||
|
@SpringBootApplication(scanBasePackages = { "com.baeldung.chaosmonkey" })
|
||||||
|
public class SpringBootChaosMonkeyApp {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(SpringBootChaosMonkeyApp.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.baeldung.chaosmonkey.controller;
|
||||||
|
|
||||||
|
import com.baeldung.chaosmonkey.service.PermissionsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by adi on 8/2/18.
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/permissions")
|
||||||
|
public class PermissionsController {
|
||||||
|
|
||||||
|
@Autowired private PermissionsService permissionsService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
public List<String> getAllPermissions() {
|
||||||
|
return permissionsService.getAllPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.baeldung.chaosmonkey.service;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by adi on 8/2/18.
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PermissionsService {
|
||||||
|
|
||||||
|
public List<String> getAllPermissions() {
|
||||||
|
return Arrays.asList("CREATE", "READ", "UPDATE", "DELETE");
|
||||||
|
}
|
||||||
|
}
|
|
@ -43,3 +43,34 @@ servlet.mapping=/dispatcherExampleURL
|
||||||
#spring.banner.image.invert= //TODO
|
#spring.banner.image.invert= //TODO
|
||||||
|
|
||||||
contactInfoType=email
|
contactInfoType=email
|
||||||
|
|
||||||
|
#chaos monkey for spring boot props
|
||||||
|
management.endpoint.chaosmonkey.enabled=true
|
||||||
|
management.endpoint.chaosmonkeyjmx.enabled=true
|
||||||
|
|
||||||
|
spring.profiles.active=chaos-monkey
|
||||||
|
#Determine whether should execute or not
|
||||||
|
chaos.monkey.enabled=true
|
||||||
|
#How many requests are to be attacked. 1: attack each request; 5: each 5th request is attacked
|
||||||
|
chaos.monkey.assaults.level=1
|
||||||
|
#Minimum latency in ms added to the request
|
||||||
|
chaos.monkey.assaults.latencyRangeStart=3000
|
||||||
|
#Maximum latency in ms added to the request
|
||||||
|
chaos.monkey.assaults.latencyRangeEnd=15000
|
||||||
|
#Latency assault active
|
||||||
|
chaos.monkey.assaults.latencyActive=true
|
||||||
|
#Exception assault active
|
||||||
|
chaos.monkey.assaults.exceptionsActive=false
|
||||||
|
#AppKiller assault active
|
||||||
|
chaos.monkey.assaults.killApplicationActive=false
|
||||||
|
#Controller watcher active
|
||||||
|
chaos.monkey.watcher.controller=false
|
||||||
|
#RestController watcher active
|
||||||
|
chaos.monkey.watcher.restController=false
|
||||||
|
#Service watcher active
|
||||||
|
chaos.monkey.watcher.service=true
|
||||||
|
#Repository watcher active
|
||||||
|
chaos.monkey.watcher.repository=false
|
||||||
|
#Component watcher active
|
||||||
|
chaos.monkey.watcher.component=false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue