- <dependency>
- <groupId>org.apache.dubbogroupId>
- <artifactId>dubbo-spring-boot-starterartifactId>
- <version>2.7.8version>
- dependency>
- <dependency>
- <groupId>org.apache.dubbogroupId>
- <artifactId>dubbo-dependencies-zookeeperartifactId>
- <version>2.7.8version>
- <type>pomtype>
- <exclusions>
- <exclusion>
- <groupId>org.slf4jgroupId>
- <artifactId>slf4j-log4j12artifactId>
- exclusion>
- exclusions>
- dependency>
- dubbo:
- registry:
- address: zookeeper://192.168.88.130:2181
- timeout: 250000
- scan:
- base-packages: com.example.dataservice.service.impl
- provider:
- timeout: 50000
- retries: 0 # 失败重试次数
- dubbo:
- registry:
- address: zookeeper://192.168.88.130:2181
- timeout: 250000
- scan:
- base-packages: com.example.front
- consumer:
- check: false
- timeout: 50000
- retries: 0
启动Dubbo,做用于SpringBoot启动类上;
作用于ServiceImpl类上
@DubboService(interfaceClass = PlatBaseInfoService.class, version = "1.0")
作用于Controller类中的注入Service对象上
@DubboReference(interfaceClass = PlatBaseInfoService.class,version = "1.0")