Skip to content

Commit c21ae6f

Browse files
committed
Modify Directory and Person Service
1 parent c62e919 commit c21ae6f

File tree

28 files changed

+147
-140
lines changed

28 files changed

+147
-140
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Spring Boot version: 2.3.11.RELEASE
3232

3333
### Other Microservices
3434
- Spring Boot version: 2.5.0
35-
- User, Department, Task Services
35+
- Person, Department, Task Services
3636
- Dependencies:
3737
- spring-cloud-starter-config
3838
- spring-cloud-starter-netflix-eureka-client
@@ -49,3 +49,10 @@ Docker
4949
The Docker Zipkin project is able to build docker images, provide scripts and a docker-compose.yml for launching pre-built images. The quickest start is to run the latest image directly:
5050

5151
docker run -d -p 9411:9411 openzipkin/zipkin
52+
53+
54+
Health : http://localhost:9191/actuator/health
55+
Eureka : http://localhost:8761/
56+
Department GetMethod: http://localhost:9191/departments/1
57+
Hystrix: http://localhost:9295/hystrix
58+
http://localhost:9295/hystrix/monitor?stream=http%3A%2F%2Flocalhost%3A9191%2Factuator%2Fhystrix.stream

api-gateway/src/main/java/com/cevher/ms/cloud/gateway/FallBackResource.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
public class FallBackResource {
1111

1212
/**
13-
* For User Microservices CircuitBreaker
13+
* For Person Microservices CircuitBreaker
1414
* @return FallBack Message
1515
*/
16-
@GetMapping("/userServiceFallBack")
17-
public String userServiceFallBack(){
18-
return "FallBack User Controller!.. User Service is taking longer then Expected.";
16+
@GetMapping("/personServiceFallBack")
17+
public String personServiceFallBack(){
18+
return "FallBack Person Controller!.. Person Service is taking longer then Expected.";
1919
}
2020

2121
/**

api-gateway/src/main/resources/application.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ spring:
88
cloud:
99
gateway:
1010
routes:
11-
- id: user-service
12-
uri: lb://user-service
11+
- id: person-service
12+
uri: lb://person-service
1313
predicates:
14-
- Path=/users/**
14+
- Path=/people/**
1515
filters:
1616
- name: CircuitBreaker
1717
args:
18-
name: user-service
19-
fallbackuri: forward:/userServiceFallBack
18+
name: person-service
19+
fallbackuri: forward:/personServiceFallBack
2020
- id: department-service
2121
uri: lb://department-service
2222
predicates:

api-gateway/src/test/java/com/cevher/ms/cloud/gateway/APIGatewayApplicationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ void contextLoads() {
2424

2525
@Ignore("not yet ready , Please ignore.")
2626
@Test
27-
void fallBackUser() throws Exception {
27+
void fallBackPerson() throws Exception {
2828
assertThat(this.restTemplate
29-
.getForObject("http://127.0.0.1:" + port + "/userServiceFallBack", String.class)
30-
).contains("FallBack User Controller");
29+
.getForObject("http://127.0.0.1:" + port + "/personServiceFallBack", String.class)
30+
).contains("FallBack Person Controller");
3131
}
3232

3333
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)