Home

Awesome

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

    <dependency>
        <groupId>com.alibaba.spring.boot</groupId>
        <artifactId>dubbo-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>
spring.application.name=dubbo-spring-boot-starter
spring.dubbo.server=true
spring.dubbo.registry=N/A
@SpringBootApplication
@EnableDubboConfiguration
public class DubboProviderLauncher {
  //...
}
@Service(interfaceClass = IHelloService.class)
@Component
public class HelloServiceImpl implements IHelloService {
  //...
}

How to consume Dubbo

    <dependency>
        <groupId>com.alibaba.spring.boot</groupId>
        <artifactId>dubbo-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>
spring.application.name=dubbo-spring-boot-starter
@SpringBootApplication
@EnableDubboConfiguration
public class DubboConsumerLauncher {
  //...
}
@Component
public class HelloConsumer {
  @Reference(url = "dubbo://127.0.0.1:20880")
  private IHelloService iHelloService;

}

Reference