Spring Boot 集成 Dubbo
在集成Spring Boot和Dubbo的过程中,遇到一些问题,在此记录一下:
- 依赖
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-nacos-spring-boot-starter</artifactId>
<version>3.3.0</version>
</dependency>
- 配置
2.1 服务提供者
dubbo:
protocol:
name: dubbo
port: 20880
registry:
address: nacos://127.0.0.1:8848
register-mode: instance
scan:
base-packages: com.example.service
2.2 服务消费者
dubbo:
registry:
address: nacos://127.0.0.1:8848
register-mode: instance # 新用户请设置此值,表示启用应用级服务发现,可选值 interface、instance、all
parameters.register-consumer-url: true
参考资料: