Skip to content

Commit c204a80

Browse files
committed
added RabbitMQ, Sleuth, Zipkin for distributed tracing and Cloud Bug for congig refresh
1 parent 49cb731 commit c204a80

File tree

6 files changed

+112
-7
lines changed

6 files changed

+112
-7
lines changed

api-gateway/pom.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
34
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
45
<modelVersion>4.0.0</modelVersion>
56
<parent>
67
<groupId>org.springframework.boot</groupId>
78
<artifactId>spring-boot-starter-parent</artifactId>
89
<version>2.3.4.RELEASE</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10+
<relativePath /> <!-- lookup parent from repository -->
1011
</parent>
1112
<groupId>com.smallintro</groupId>
1213
<artifactId>api-gateway</artifactId>
@@ -17,6 +18,7 @@
1718
<properties>
1819
<java.version>1.8</java.version>
1920
<spring-cloud.version>Hoxton.SR8</spring-cloud.version>
21+
<spring-boot-admin.version>2.3.0</spring-boot-admin.version>
2022
</properties>
2123

2224
<dependencies>
@@ -58,10 +60,42 @@
5860
<groupId>org.springframework.boot</groupId>
5961
<artifactId>spring-boot-starter-actuator</artifactId>
6062
</dependency>
63+
<dependency>
64+
<groupId>org.springframework.boot</groupId>
65+
<artifactId>spring-boot-starter-amqp</artifactId>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.springframework.cloud</groupId>
69+
<artifactId>spring-cloud-starter-sleuth</artifactId>
70+
</dependency>
71+
<dependency>
72+
<groupId>org.springframework.cloud</groupId>
73+
<artifactId>spring-cloud-starter-zipkin</artifactId>
74+
</dependency>
75+
<dependency>
76+
<groupId>org.springframework.amqp</groupId>
77+
<artifactId>spring-rabbit-test</artifactId>
78+
<scope>test</scope>
79+
</dependency>
80+
<dependency>
81+
<groupId>org.springframework.cloud</groupId>
82+
<artifactId>spring-cloud-bus</artifactId>
83+
</dependency>
84+
<dependency>
85+
<groupId>de.codecentric</groupId>
86+
<artifactId>spring-boot-admin-starter-client</artifactId>
87+
</dependency>
6188
</dependencies>
6289

6390
<dependencyManagement>
6491
<dependencies>
92+
<dependency>
93+
<groupId>de.codecentric</groupId>
94+
<artifactId>spring-boot-admin-dependencies</artifactId>
95+
<version>${spring-boot-admin.version}</version>
96+
<type>pom</type>
97+
<scope>import</scope>
98+
</dependency>
6599
<dependency>
66100
<groupId>org.springframework.cloud</groupId>
67101
<artifactId>spring-cloud-dependencies</artifactId>

config-server/src/main/resources/configurations/api-gateway.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,29 @@ zuul:
2020
eureka:
2121
client:
2222
service-url:
23-
defaultZone: http://localhost:8761/eureka
23+
defaultZone: http://localhost:8761/eureka
24+
25+
#Actuator
26+
management:
27+
endpoints:
28+
web:
29+
exposure:
30+
include: "*"
31+
endpoint:
32+
health:
33+
show-details: always
34+
matrics:
35+
export:
36+
jmx:
37+
enabled: true
38+
39+
#Spring-boot admin
40+
spring:
41+
boot:
42+
admin:
43+
client:
44+
url: http://127.0.0.1:9080
45+
instance:
46+
metadata:
47+
tags:
48+
environment: dev

config-server/src/main/resources/configurations/project-service.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ spring.jpa.show-sql = true
2020
#Disable trace in error response
2121
server.error.include-stacktrace=never
2222

23-
#Actuator and Springboot admin
23+
#Actuator
2424
management.endpoints.web.exposure.include=*
2525
management.endpoint.health.show-details=always
2626
info.app.name=Project Manager
2727
info.app.version=v1.0
28-
# Springboot admin
28+
# Spring-boot admin
2929
spring.boot.admin.client.url=http://127.0.0.1:9080
3030
spring.boot.admin.client.instance.metadata.tags.environment=dev
3131
management.matrics.export.jmx.enabled: true

config-server/src/main/resources/configurations/user-service.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ spring.jpa.show-sql = true
2020
#Disable trace in error response
2121
server.error.include-stacktrace=never
2222

23-
#Actuator and Springboot admin
23+
#Actuator
2424
management.endpoints.web.exposure.include=*
2525
management.endpoint.health.show-details=always
2626
info.app.name=Employee Manager
2727
info.app.version=v1.0
28-
# Springboot admin
28+
# Spring-boot admin
2929
spring.boot.admin.client.url=http://127.0.0.1:9080
3030
spring.boot.admin.client.instance.metadata.tags.environment=dev
3131
management.matrics.export.jmx.enabled: true

employee-mgr/pom.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,31 @@
116116
<groupId>org.springframework.cloud</groupId>
117117
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
118118
</dependency>
119+
<dependency>
120+
<groupId>org.springframework.boot</groupId>
121+
<artifactId>spring-boot-starter-amqp</artifactId>
122+
</dependency>
123+
<dependency>
124+
<groupId>org.springframework.cloud</groupId>
125+
<artifactId>spring-cloud-bus</artifactId>
126+
</dependency>
127+
<dependency>
128+
<groupId>org.springframework.cloud</groupId>
129+
<artifactId>spring-cloud-starter-sleuth</artifactId>
130+
</dependency>
131+
<dependency>
132+
<groupId>org.springframework.cloud</groupId>
133+
<artifactId>spring-cloud-starter-zipkin</artifactId>
134+
</dependency>
135+
<dependency>
136+
<groupId>org.springframework.cloud</groupId>
137+
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
138+
</dependency>
139+
<dependency>
140+
<groupId>org.springframework.amqp</groupId>
141+
<artifactId>spring-rabbit-test</artifactId>
142+
<scope>test</scope>
143+
</dependency>
119144
</dependencies>
120145

121146
<build>

project-mgr/pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,27 @@
101101
<groupId>org.springframework.cloud</groupId>
102102
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
103103
</dependency>
104+
<dependency>
105+
<groupId>org.springframework.boot</groupId>
106+
<artifactId>spring-boot-starter-amqp</artifactId>
107+
</dependency>
108+
<dependency>
109+
<groupId>org.springframework.cloud</groupId>
110+
<artifactId>spring-cloud-starter-sleuth</artifactId>
111+
</dependency>
112+
<dependency>
113+
<groupId>org.springframework.cloud</groupId>
114+
<artifactId>spring-cloud-starter-zipkin</artifactId>
115+
</dependency>
116+
<dependency>
117+
<groupId>org.springframework.amqp</groupId>
118+
<artifactId>spring-rabbit-test</artifactId>
119+
<scope>test</scope>
120+
</dependency>
121+
<dependency>
122+
<groupId>org.springframework.cloud</groupId>
123+
<artifactId>spring-cloud-bus</artifactId>
124+
</dependency>
104125
</dependencies>
105126

106127
<build>

0 commit comments

Comments
 (0)