Spring Boot

Develop Dubbo applications using Annotation and Spring Boot

For details about Spring Boot annotations and basic usage, please refer to User Guide - Spring Boot. Below are the configuration details and starter list supported by Spring Boot.

application.yaml

Below is the list of configuration components supported by the Dubbo framework, which can be specified in the Spring Boot configuration file.

Configuration Example

dubbo:
  application:
      name: dubbo-springboot-demo-provider
      logger: slf4j
  protocol:
    name: dubbo
    port: 50052
  registry:
    address: nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos

dubbo

dubbo.metrics

dubbo.tracing

Starter List

dubbo-spring-boot-starter

Here are some version mappings of the dubbo-spring-boot-starter that correspond to Spring Boot and JDK dependencies:

VersionCompatible Spring Boot Range
3.3.x[1.x ~ 3.x)
3.2.x[1.x ~ 3.x)
3.1.x[1.x ~ 2.x)
2.7.x[1.x ~ 2.x)

Other Component Starters

Here is the list of starters provided by the Dubbo official community (version 3.3.0+) for quick usage in Spring Boot applications:

  • dubbo-spring-boot-starter, manages the core dubbo dependencies, identifies configuration items starting with dubbo. in application.properties or application.yml, and scans annotations like @DubboService.
  • dubbo-spring-boot-starter3, manages the same core dubbo dependencies as dubbo-spring-boot-starter, supports Spring Boot version 3.2.
  • dubbo-nacos-spring-boot-starter, manages nacos-client and other dependencies to introduce when using Nacos as the registry and configuration center.
  • dubbo-zookeeper-spring-boot-starter, manages zookeeper, curator and other dependencies to introduce when using Zookeeper as the registry and configuration center (for Zookeeper server version 3.4 and below).
  • dubbo-zookeeper-curator5-spring-boot-starter, manages zookeeper, curator5 and other dependencies to introduce when using Zookeeper as the registry and configuration center.
  • dubbo-sentinel-spring-boot-starter, manages sentinel and other dependencies to introduce when using Sentinel for rate limiting and degradation.
  • dubbo-seata-spring-boot-starter, manages seata and other dependencies to introduce when using Seata as a distributed transaction solution.
  • dubbo-observability-spring-boot-starter, adding this dependency will automatically enable the built-in metrics collection of Dubbo, which can be used for subsequent monitoring systems like Prometheus and Grafana.
  • dubbo-tracing-brave-spring-boot-starter, manages brave/zipkin, micrometer, and related dependencies, uses Brave/Zipkin as Tracer, and exports Trace information to Zipkin.
  • dubbo-tracing-otel-otlp-spring-boot-starter, manages brave/zipkin, micrometer, and related dependencies, uses OpenTelemetry as Tracer, and exports Trace information to OTlp Collector.
  • dubbo-tracing-otel-zipkin-spring-boot-starter, manages brave/zipkin, micrometer, and related dependencies, uses OpenTelemetry as Tracer, and exports Trace information to Zipkin.
Last modified September 30, 2024: Translate (c420e80ed4)