Last active
January 3, 2021 04:36
-
-
Save skaveesh/e54925cbf54014ee9d9135ca5af748cc to your computer and use it in GitHub Desktop.
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//code is omitted for brevity | |
@RestController("/") | |
public class Controller { | |
//code is omitted for brevity | |
@GetMapping(value = "calltest", produces = MediaType.APPLICATION_JSON_VALUE) | |
public ResponseEntity<Object> callTest(){ | |
return new ResponseEntity<>(downstreamService.callTest(), HttpStatus.OK); | |
} | |
@GetMapping(value = "calltestslow", produces = MediaType.APPLICATION_JSON_VALUE) | |
public ResponseEntity<Object> callTestSlow(){ | |
return new ResponseEntity<>(downstreamService.callTestSlow(), HttpStatus.OK); | |
} | |
@GetMapping(value = "calltesterror", produces = MediaType.APPLICATION_JSON_VALUE) | |
public ResponseEntity<Object> callTestError(){ | |
return new ResponseEntity<>(downstreamService.callTestError(), HttpStatus.OK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment