将 user 模块接入 SCA Dubbo 和 Nacos Discovery 组件
This commit is contained in:
parent
a0e9687f1b
commit
ac2ee0a1e9
12
user/pom.xml
12
user/pom.xml
|
@ -18,4 +18,16 @@
|
||||||
<module>user-service-impl</module>
|
<module>user-service-impl</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.iocoder.mall</groupId>
|
||||||
|
<artifactId>common-dependencies</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -55,22 +55,14 @@
|
||||||
|
|
||||||
<!-- RPC 相关 -->
|
<!-- RPC 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.dubbo</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>dubbo</artifactId>
|
<artifactId>spring-cloud-starter-dubbo</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.dubbo</groupId>
|
|
||||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Registry 和 Config 相关 -->
|
<!-- Registry 和 Config 相关 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.curator</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>curator-recipes</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.curator</groupId>
|
|
||||||
<artifactId>curator-framework</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- MQ 相关 -->
|
<!-- MQ 相关 -->
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
spring:
|
|
||||||
# datasource
|
|
||||||
datasource:
|
|
||||||
url: jdbc:mysql://192.168.88.14:3306/mall_user?useSSL=false&useUnicode=true&characterEncoding=UTF-8
|
|
||||||
driver-class-name: com.mysql.jdbc.Driver
|
|
||||||
username: root
|
|
||||||
password: ${MALL_MYSQL_PASSWORD}
|
|
|
@ -6,6 +6,13 @@ spring:
|
||||||
username: root
|
username: root
|
||||||
password: ${MALL_MYSQL_PASSWORD}
|
password: ${MALL_MYSQL_PASSWORD}
|
||||||
|
|
||||||
|
# Spring Cloud 配置项
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Spring Cloud Nacos Discovery 配置项
|
||||||
|
discovery:
|
||||||
|
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||||
|
|
||||||
# mybatis-plus
|
# mybatis-plus
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
@ -18,15 +25,22 @@ mybatis-plus:
|
||||||
mapperLocations: classpath*:mapper/*.xml
|
mapperLocations: classpath*:mapper/*.xml
|
||||||
typeAliasesPackage: cn.iocoder.mall.user.biz.dataobject
|
typeAliasesPackage: cn.iocoder.mall.user.biz.dataobject
|
||||||
|
|
||||||
# dubbo
|
# Dubbo 配置项
|
||||||
dubbo:
|
dubbo:
|
||||||
|
# Dubbo 注册中心
|
||||||
registry:
|
registry:
|
||||||
address: zookeeper://127.0.0.1:2181
|
address: spring-cloud://127.0.0.1:8848 # 指定 Dubbo 服务注册中心的地址
|
||||||
|
# Spring Cloud Alibaba Dubbo 专属配置
|
||||||
|
cloud:
|
||||||
|
subscribed-services: admin-application, product-application # 设置订阅的应用列表,默认为 * 订阅所有应用
|
||||||
|
# Dubbo 提供者的协议
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
|
||||||
name: dubbo
|
name: dubbo
|
||||||
|
port: -1
|
||||||
|
# Dubbo 提供服务的扫描基础包
|
||||||
scan:
|
scan:
|
||||||
base-packages: cn.iocoder.mall.user.biz.service
|
base-packages: cn.iocoder.mall.user.biz.service
|
||||||
|
# Dubbo 服务提供者的配置
|
||||||
provider:
|
provider:
|
||||||
filter: -exception
|
filter: -exception
|
||||||
MobileCodeService:
|
MobileCodeService:
|
||||||
|
|
Loading…
Reference in New Issue