天天看點

dubbo-springboot

一、服務提供者boot-user-service-provider

服務提供者boot-user-service-provider代碼結構如下:

dubbo-springboot

1、服務提供者boot-user-service-provider引入spring-boot-starter以及dubbo和curator的依賴

<dependency>

  <groupId>org.springframework.boot</groupId>

  <artifactId>spring-boot-starter</artifactId>

</dependency>

  <groupId>com.alibaba.boot</groupId>

  <artifactId>dubbo-spring-boot-starter</artifactId>

  <version>0.2.0</version>

2、配置檔案application.properties

3、UserService接口實作UserServiceImpl

4、主程式

二、服務消費者boot-order-service-consumer

服務消費者boot-order-service-consumer代碼結構如下:

dubbo-springboot

1、pom.xml

2、配置檔案application.propertise

3、OrderService接口實作OrderServiceImpl

4、OrderController

5、主程式