Alibaba Cloud Toolkit lets you run a local service registry or join a custom registry directly from IntelliJ IDEA. With this setup, your on-premises microservice applications can discover and call cloud-deployed applications on Enterprise Distributed Application Service (EDAS), and vice versa, without manually editing configuration files or binding hosts. This helps you improve development efficiency.
Before you begin
Install and configure Alibaba Cloud Toolkit in IntelliJ IDEA. For instructions, see Install and configure Alibaba Cloud Toolkit in IntelliJ IDEA.
Make sure the required ports are available on your machine. See the port requirements section below for details.
Supported frameworks and port requirements
Alibaba Cloud Toolkit supports three microservice frameworks: High-speed Service Framework (HSF), Spring Cloud, and Apache Dubbo.
Port requirements
The ports that must be available depend on your framework:
| Framework | Required ports | Details |
|---|---|---|
| HSF (lightweight configuration center) | 8080, 8848, 9600 | All three ports must be free |
| Spring Cloud or Apache Dubbo (open-source Nacos) | 8080, 8848 | Both ports must be free |
Each port serves a specific purpose:
| Port | Purpose |
|---|---|
| 8848 | Nacos service registration and configuration management |
| 9600 | HSF or Apache Dubbo service registration and subscription |
| 8080 | Alibaba Naming Service (ANS) service registration and Application Configuration Management (ACM) configuration management |
Workflow overview
Download and open the sample projects in IntelliJ IDEA.
Configure the registry in Alibaba Cloud Toolkit for each project.
Run both projects and verify that the services communicate.
Step 1: Download and open the sample projects
Download the following sample projects:
Extract both ZIP files and open each project in IntelliJ IDEA.
Complete Step 2 for each project.
Step 2: Configure the registry
In IntelliJ IDEA, choose File > Settings.
In the left pane, go to Alibaba Cloud Toolkit > Microservice.
Select a registry option:
Note This guide uses Use Local Registry to demonstrate the setup.Option Description No Registry No registry is used. Use Local Registry Starts the local lightweight configuration center. Requires ports 8848, 9600, and 8080 to be free. After you select this option, click Start to launch the registry or Stop to shut it down. Access the registry console at http://localhost:<Specified port>.Join Custom Registry Connects to a registry at a domain name or IP address that you specify. When your applications run in your on-premises environment, EDAS uses -DJVM parameters to configure the registry for your applications and registers the applications in the registry.Interconnection Between On-premises and Cloud Applications Enables mutual calling and testing between on-premises and cloud-deployed applications. Click Apply, then click OK.
Step 3: Run the projects and verify the result
Start both the
nacos-service-providerandnacos-service-consumerprojects in IntelliJ IDEA.Open a browser and go to
https://127.0.0.1:18082/echo-feign/helloworld. Port18082is the consumer project's port.If the page returns the string
helloworld, the provider and consumer are communicating through the local registry, and on-premises-to-cloud interconnection is working as expected.