From 72ed49033458e3f9e129f53f5a249c06ac7da4ed Mon Sep 17 00:00:00 2001
From: YunaiV <>
Date: Sun, 2 Aug 2020 22:59:06 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20product-service-app=20?=
=?UTF-8?q?=E7=9A=84=20dev=20=E7=9A=84=E6=B3=A8=E5=86=8C=E4=B8=AD=E5=BF=83?=
=?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../product-service-app/pom.xml | 19 +++++++++++++++++++
.../src/main/resources/application-dev.yaml | 3 ++-
.../src/main/resources/application.yaml | 6 ++++++
3 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/product-service-project/product-service-app/pom.xml b/product-service-project/product-service-app/pom.xml
index 3e34d8f19..e91aec96f 100644
--- a/product-service-project/product-service-app/pom.xml
+++ b/product-service-project/product-service-app/pom.xml
@@ -30,6 +30,12 @@
product-service-api
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
cn.iocoder.mall
@@ -58,6 +64,12 @@
mall-spring-boot-starter-mybatis
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
org.springframework.boot
@@ -88,6 +100,13 @@
${project.artifactId}
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
diff --git a/product-service-project/product-service-app/src/main/resources/application-dev.yaml b/product-service-project/product-service-app/src/main/resources/application-dev.yaml
index 10c3b0e7b..dea36f740 100644
--- a/product-service-project/product-service-app/src/main/resources/application-dev.yaml
+++ b/product-service-project/product-service-app/src/main/resources/application-dev.yaml
@@ -17,4 +17,5 @@ spring:
dubbo:
# Dubbo 注册中心
registry:
- address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址
+ # address: spring-cloud://400-infra.server.iocoder.cn:8848 # 指定 Dubbo 服务注册中心的地址
+ address: nacos://400-infra.server.iocoder.cn:8848?namespace=dev # 指定 Dubbo 服务注册中心的地址
diff --git a/product-service-project/product-service-app/src/main/resources/application.yaml b/product-service-project/product-service-app/src/main/resources/application.yaml
index 3caf2f162..e169a0bfa 100644
--- a/product-service-project/product-service-app/src/main/resources/application.yaml
+++ b/product-service-project/product-service-app/src/main/resources/application.yaml
@@ -46,6 +46,12 @@ rocketmq:
producer:
group: ${spring.application.name}-producer-group
+# Actuator 监控配置项
+management:
+ server.port: 38082 # 独立端口,避免被暴露出去
+ endpoints.web.exposure.include: '*' # 暴露所有监控端点
+server.port: ${management.server.port} # 设置使用 Actuator 的服务器端口,因为 RPC 服务不需要 Web 端口
+
# Mall 配置项
mall:
# 错误码配置项对应 ErrorCodeProperties 配置类