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 perform complex operations, such as modifying configuration files and binding hosts. 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.

Prerequisites

Alibaba Cloud Toolkit is installed and configured. For more information, see Install and configure Alibaba Cloud Toolkit in IntelliJ IDEA.

Limits

The features support three microservice frameworks: High-speed Service Framework (HSF), Spring Cloud, and Apache Dubbo. If you use the lightweight 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.

Implement on-premises application development and the interconnection between on-premises and cloud applications

  1. Download the nacos-service-provider and nacos-service-consumer projects. Then, open the two projects in IntelliJ IDEA, and perform Step 2 to Step 5 to configure each project.
  2. In the top navigation bar of IntelliJ IDEA, choose File > Settings.
  3. In the left-side navigation page of the Settings page, choose Alibaba Cloud Toolkit > Microservice. Then, set the registry parameters.

    The following table describes the parameters.

    Parameter Description
    No Registry No registry is used.
    Use Local Registry Use the local lightweight 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 applications in the registry.
    Interconnection Between On-premises and Cloud Applications You can implement the interconnection between on-premises and cloud applications for mutual calling and testing.
    Note In the example of this topic, Use Local Registry is selected to verify the results.
  4. After you set the parameters, click Apply and OK.
  5. Run the nacos-service-provider and nacos-service-consumer projects.

Result

Visit https://127.0.0.1:18082/echo-feign/helloworld by using your browser. 18082 is the port number for the consumer project. If the helloworld string is displayed, the interconnection between the on-premises and cloud applications is implemented for the two projects as expected.