dubbo-spring-boot-starter

Dubbo Spring Boot Starter。

  • 所有者: alibaba/dubbo-spring-boot-starter
  • 平台: BSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

dubbo-spring-boot-starter Maven Central

中文版文档

Dubbo Spring Boot Starter. Dubbo official dubbo-spring-boot-project

Support jdk version 1.6 or 1.6+

(please import googlestyle-java.xml if you want to modify the code)

How to publish dubbo

  • add Dependencies:
    <dependency>
        <groupId>com.alibaba.spring.boot</groupId>
        <artifactId>dubbo-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>
  • add dubbo configuration in application.properties, demo:
spring.application.name=dubbo-spring-boot-starter
spring.dubbo.server=true
spring.dubbo.registry=N/A
  • then add @EnableDubboConfiguration on Spring Boot Application, indicates that dubbo is enabled.(web or non-web application can use dubbo provider)
@SpringBootApplication
@EnableDubboConfiguration
public class DubboProviderLauncher {
  //...
}
  • code your dubbo service, add @Service(import com.alibaba.dubbo.config.annotation.Service) on your service class, and interfaceClass is the interface which will be published.
@Service(interfaceClass = IHelloService.class)
@Component
public class HelloServiceImpl implements IHelloService {
  //...
}
  • Start Spring Boot.

How to consume Dubbo

  • add Dependencies:
    <dependency>
        <groupId>com.alibaba.spring.boot</groupId>
        <artifactId>dubbo-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>
  • add dubbo configuration in application.properties, demo:
spring.application.name=dubbo-spring-boot-starter
  • then add @EnableDubboConfiguration on Spring Boot Application
@SpringBootApplication
@EnableDubboConfiguration
public class DubboConsumerLauncher {
  //...
}
  • injection interface by the @Reference annotation.
@Component
public class HelloConsumer {
  @Reference(url = "dubbo://127.0.0.1:20880")
  private IHelloService iHelloService;

}

Reference

主要指標

概覽
名稱與所有者alibaba/dubbo-spring-boot-starter
主編程語言Java
編程語言Java (語言數: 1)
平台BSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
許可證Apache License 2.0
所有者活动
創建於2017-01-20 08:02:19
推送於2018-06-14 10:43:15
最后一次提交2018-03-19 15:44:38
發布數4
最新版本名稱v2.0.0 (發布於 2018-03-11 17:10:59)
第一版名稱v1.0.0 (發布於 2018-01-22 22:58:08)
用户参与
星數2.1k
關注者數199
派生數744
提交數34
已啟用問題?
問題數104
打開的問題數32
拉請求數3
打開的拉請求數1
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?