将 search 模块接入 SCA Dubbo 和 Nacos Discovery 组件

This commit is contained in:
YunaiV 2020-04-12 20:36:29 +08:00
parent 60db9b9a77
commit 3b49aff5a4
3 changed files with 34 additions and 21 deletions

View File

@ -16,4 +16,17 @@
<module>search-service-api</module>
<module>search-service-impl</module>
</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>

View File

@ -42,22 +42,14 @@
<!-- RPC 相关 -->
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-dubbo</artifactId>
</dependency>
<!-- Registry 和 Config 相关 -->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- MQ 相关 -->
@ -78,10 +70,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId> <!-- 引入该包,为了写单元测试用 -->
<artifactId>curator-framework</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId> <!-- 引入该包,为了写单元测试用 -->
<artifactId>spring-boot-starter-web</artifactId>

View File

@ -7,17 +7,29 @@ spring:
repositories:
enable: true
# dubbo
# Spring Cloud 配置项
cloud:
nacos:
# Spring Cloud Nacos Discovery 配置项
discovery:
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
# Dubbo 配置项
dubbo:
application:
name: search-service
# Dubbo 注册中心
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, order-application, product-application # 设置订阅的应用列表,默认为 * 订阅所有应用
# Dubbo 提供者的协议
protocol:
port: -1
name: dubbo
port: -1
# Dubbo 提供服务的扫描基础包
scan:
base-packages: cn.iocoder.mall.search.biz.service
# Dubbo 服务提供者的配置
provider:
filter: -exception
ProductSearchService: