将 search 模块接入 SCA Dubbo 和 Nacos Discovery 组件
This commit is contained in:
parent
60db9b9a77
commit
3b49aff5a4
@ -16,4 +16,17 @@
|
|||||||
<module>search-service-api</module>
|
<module>search-service-api</module>
|
||||||
<module>search-service-impl</module>
|
<module>search-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>
|
||||||
|
@ -42,22 +42,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-framework</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.curator</groupId>
|
|
||||||
<artifactId>curator-recipes</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- MQ 相关 -->
|
<!-- MQ 相关 -->
|
||||||
@ -78,10 +70,6 @@
|
|||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.curator</groupId> <!-- 引入该包,为了写单元测试用 -->
|
|
||||||
<artifactId>curator-framework</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId> <!-- 引入该包,为了写单元测试用 -->
|
<groupId>org.springframework.boot</groupId> <!-- 引入该包,为了写单元测试用 -->
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
@ -7,17 +7,29 @@ spring:
|
|||||||
repositories:
|
repositories:
|
||||||
enable: true
|
enable: true
|
||||||
|
|
||||||
# dubbo
|
# Spring Cloud 配置项
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# Spring Cloud Nacos Discovery 配置项
|
||||||
|
discovery:
|
||||||
|
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||||
|
|
||||||
|
# Dubbo 配置项
|
||||||
dubbo:
|
dubbo:
|
||||||
application:
|
# Dubbo 注册中心
|
||||||
name: search-service
|
|
||||||
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, order-application, product-application # 设置订阅的应用列表,默认为 * 订阅所有应用
|
||||||
|
# Dubbo 提供者的协议
|
||||||
protocol:
|
protocol:
|
||||||
port: -1
|
|
||||||
name: dubbo
|
name: dubbo
|
||||||
|
port: -1
|
||||||
|
# Dubbo 提供服务的扫描基础包
|
||||||
scan:
|
scan:
|
||||||
base-packages: cn.iocoder.mall.search.biz.service
|
base-packages: cn.iocoder.mall.search.biz.service
|
||||||
|
# Dubbo 服务提供者的配置
|
||||||
provider:
|
provider:
|
||||||
filter: -exception
|
filter: -exception
|
||||||
ProductSearchService:
|
ProductSearchService:
|
||||||
|
Loading…
Reference in New Issue
Block a user