A microservices model contains multiple microservice applications. These applications can be written in different languages, such as Java, PHP, and Node.js. In Enterprise Distributed Application Service (EDAS), you can use Service Mesh (ASM) to deploy multi-language applications. This enables interoperability between multi-language applications and Spring Cloud applications.
Prerequisites
The multi-language application is deployed to a Kubernetes cluster in EDAS.
NoteWhen you deploy multilingual applications, Service Mesh is already installed and enabled.
The Spring Cloud application uses a Nacos 1.2.1 instance that is hosted on Microservices Engine (MSE) as the registry. For more information, see Create a Nacos engine.
Background information
The interoperability between multi-language applications and Spring Cloud applications is achieved through the following process:
ASM connects to the Nacos 1.2.1 instance that is hosted on MSE. This enables communication between ASM and the Spring Cloud applications registered with Nacos.
The DNS proxy of ASM is enabled to resolve the domain names of multi-language applications in ASM.
The multi-language application accesses the Spring Cloud application using the domain name generated in ASM. The Spring Cloud application accesses the multi-language application using its access method in the Kubernetes cluster.
Procedure
In the MSE console, you can enable the Mesh Configuration Protocol (MCP) feature for the Nacos instance that the Spring Cloud application uses. This enables communication with ASM.
You can enable the DNS proxy in ASM. For more information, see Use a DNS proxy in ASM.
In the code of the multi-language application, you can add the request domain name of the Spring Cloud application. For example,
http://scc.test.public.nacos/xxxx.NoteIf your application is already deployed, you must modify the application code and then upgrade the application. For more information, see Overview of application upgrades and rollbacks (Kubernetes).
The domain name consists of the following parts:
scc: The name of the Spring Cloud application.test: The group name of the Spring Cloud application in Nacos.public: The namespace of the Spring Cloud application in Nacos.xxxx: The URL of the Spring Cloud application.
You can set an access method for the multi-language application.
Based on your interoperability scenario, you can attach a Server Load Balancer (SLB), a Service, or an Ingress to the application. For more information, see the following topics:
Verify the result
Verify that the multi-language and Spring Cloud applications can successfully communicate with each other.