edit-icon download-icon

Upgrade Dubbo to the commercial version

Last Updated: Nov 16, 2018

Currently, EDAS fully supports Spring Cloud applications and they can be deployed directly in EDAS.

  • The concept behind Spring Boot is to Build Anything, helping resolve complicated XML configuration problems.
  • The concept behind Spring Cloud is to Coordinate Anything, helping simplify the development of distributed microservices by providing a large number of spring-cloud-starters, which are convenient for component access.

Dubbo is an open source application and the official dubbo-spring-boot-starter is available now. See GitHub for details about the Dubbo code and how to use Dubbo for application development.

To enable advanced features such as distributed tracing, service analysis, and throttling and degradation for applications developed by using Dubbo, you need to upgrade Dubbo to the business edition.

This topic describes how to upgrade Dubbo of the Spring Boot programming model to the business edition by modifying the code. How to develop applications by using Dubbo is omitted here.

Download the code demo for upgrading Dubbo to the business edition from edas-dubbo-spring-boot-demo.

How to upgrade Dubbo to the business edition

Add the Maven dependency

Add the spring-cloud-starter-pandora dependency in the project pom.xml.

  1. <dependency>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-pandora</artifactId>
  4. <version>1.3</version>
  5. </dependency>

Add or modify the Maven packaging plugin

Add or modify the Maven packaging plugin in the project pom.xml.To avoid conflicts with other packaging plugins, do not add other FatJar plugins in the build plugin.

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>com.taobao.pandora</groupId>
  5. <artifactId>pandora-boot-maven-plugin</artifactId>
  6. <version>2.1.9.1</version>
  7. <executions>
  8. <execution>
  9. <phase>package</phase>
  10. <goals>
  11. <goal>repackage</goal>
  12. </goals>
  13. </execution>
  14. </executions>
  15. </plugin>
  16. </plugins>
  17. </build>

Modify the code

In the Spring Boot start class, add the two lines of code for loading Pandora:

  1. import com.taobao.pandora.boot.PandoraBootstrap;
  2. import org.springframework.boot.SpringApplication;
  3. import org.springframework.boot.autoconfigure.SpringBootApplication;
  4. @SpringBootApplication
  5. public class ServerApplication {
  6. public static void main(String[] args) {
  7. PandoraBootstrap.run(args);
  8. SpringApplication.run(ServerApplication.class, args);
  9. PandoraBootstrap.markStartupAndWait();
  10. }
  11. }
Thank you! We've received your feedback.