This topic describes how to migrate applications developed with Dubbo to High-speed Service Framework (HSF) by adding Maven dependencies, adding or modifying the Maven packaging plug-in, and modifying configurations. However, we recommend that you do not migrate such applications to HSF because Enterprise Distributed Application Service (EDAS) already supports applications in the native Dubbo framework.
Background information
For more information about how to develop applications in the native Dubbo framework, see Use Spring Boot to develop Dubbo microservice applications. You can also directly download the sample code on how to migrate applications from Dubbo to HSF.
Add Maven dependencies
In the project configuration file that is named pom.xml, add the spring-cloud-starter-pandora
dependency.
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-pandora</artifactId>
<version>1.3</version>
</dependency>
Add or modify the Maven packaging plug-in
<build>
<plugins>
<plugin>
<groupId>com.taobao.pandora</groupId>
<artifactId>pandora-boot-maven-plugin</artifactId>
<version>2.1.9.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Modify configurations
In the startup class of Spring Boot, add the following two lines of code to load Pandora:
import com.taobao.pandora.boot.PandoraBootstrap;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ServerApplication {
public static void main(String[] args) {
PandoraBootstrap.run(args);
SpringApplication.run(ServerApplication.class, args);
PandoraBootstrap.markStartupAndWait();
}
}