<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.esint</groupId>
<artifactId>dubbo-01-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
dubbo:
scan:
base-packages: com.esint.service
@DubboService
等同:
<bean id="userService" class="com.esint.service.UserServiceImpl" />
<dubbo:service interface="com.esint.service.UserService" ref="userService" />
代码兼容性建议:服务类不仅仅要加入@DubboService
注解,同时也要设置@Service
注解。