You can use Alibaba Cloud Toolkit to start a local registry or join a custom registry in your on-premises development environment. This allows you to implement the interconnection between on-premises and cloud applications in an easy manner. You do not need to modify configuration files, bind hosts, or perform other complex operations. You can use the local registry of Alibaba Cloud Toolkit in IntelliJ IDEA to implement the interconnection between on-premises and cloud applications to improve development efficiency.
Alibaba Cloud Toolkit is installed and configured. For more information, see Install and configure Alibaba Cloud Toolkit in IntelliJ IDEA.
This feature supports three microservice frameworks: High-speed Service Framework (HSF), Spring Cloud, and Apache Dubbo. If you use the light-weight configuration center (HSF), port 8080, port 8848, and port 9600 must be occupied. If you use open source Nacos (Spring Cloud and Apache Dubbo), only port 8080 and port 8848 need to be occupied.
Develop applications in an on-premises environment and implement the interconnection between on-premises and cloud applications
- Download the nacos-service-provider and nacos-service-consumer projects. Then, open the two projects in IntelliJ IDEA, and perform steps 2 through 5 to configure each of the projects.
- In the top navigation bar of IntelliJ IDEA, choose .
- In the left-side navigation page of the Settings page, choose . Then, specify the registry parameters.
The following table describes the parameters.
Parameter Description No Registry No registry is required. Use Local Registry Use the local light-weight configuration center. If you select this option, the following three ports must be occupied:
- Port 8848: for Nacos service registration and configuration management
- Port 9600: for HSF or Apache Dubbo service registration and subscription
- Port 8080: for service registration of Alibaba Naming Service (ANS) and configuration management of Application Configuration Management (ACM)
After you select Use Local Registry, click Start to start the local registry, or click Stop to stop the local registry. Then, you can use
http://localhost:<Specified port>to access the corresponding registry console.
Join Custom Registry Specify the domain name or the IP address of your custom registry. When your applications run in your on-premises environment, Enterprise Distributed Application Service (EDAS) uses the -D parameters to configure the registry for the applications, and registers the application in the registry. Interconnection Between On-premises and Cloud Applications You can implement the interconnection between on-premises services and cloud services for mutual calling and testing. For more information.Note In this topic, Use Local Registry is selected in an example to verify the result.
- After you specify the parameters, click Apply and OK.
- Run the nacos-service-provider and nacos-service-consumer projects.
Visit http://127.0.0.1:18082/echo-feign/helloworld in your web browser. 18082 is the port number for the consumer. If the helloworld string is displayed, it means that the interconnection between on-premises services and cloud services is implemented for the two projects as expected.