dubbo-spring-boot-starter

Dubbo Spring Boot Starter。

  • Owner: alibaba/dubbo-spring-boot-starter
  • Platform: BSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
  • License:: Apache License 2.0
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Overview

Name With Owneralibaba/dubbo-spring-boot-starter
Primary LanguageJava
Program languageJava (Language Count: 1)
PlatformBSD, Cross-platform, Linux, Mac, Solaris, Unix-like, Windows
License:Apache License 2.0
Release Count4
Last Release Namev2.0.0 (Posted on 2018-03-11 17:10:59)
First Release Namev1.0.0 (Posted on 2018-01-22 22:58:08)
Created At2017-01-20 08:02:19
Pushed At2018-06-14 10:43:15
Last Commit At2018-03-19 15:44:38
Stargazers Count2.1k
Watchers Count200
Fork Count746
Commits Count34
Has Issues Enabled
Issues Count104
Issue Open Count32
Pull Requests Count3
Pull Requests Open Count1
Pull Requests Close Count7
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top