El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Access to a ServiceComb Engine

Updated on 2024-09-30 GMT+08:00

To use Spring Cloud Huawei to access ServiceComb engines, perform the following steps:

  1. Add or modify component dependencies.
  2. Add the CSE ServiceComb engine configuration to the configuration file boostrap.yaml.

For details, see Connecting Spring Cloud Applications to ServiceComb Engines. This section describes the precautions during the reconstruction, especially the precautions related to component dependency.

Assume that the original service systems are all Maven-based projects.

Step 1: Get Familiar with the POM Structure of the Original Service System

The POM structure of the Spring Cloud application system is classified into the following types:

  • The first method is to use the public POM provided by Spring Boot or Spring Cloud as the parent. For example:
    <parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>2.3.5.RELEASE</version>
    </parent>

    Alternatively, ensure that the following dependencies are introduced to the project:

    <parent>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-build</artifactId>
      <version>2.2.3.RELEASE</version>
    </parent>
  • The second method is to use the parent of the project instead of the public POM provided by Spring Boot or Spring Cloud as the parent. However, dependency management is introduced into the project. For example:
    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-dependencies</artifactId>
          <version>${spring-cloud.version}</version>
          <type>pom</type>
          <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
  • Some application systems use both the first and second methods. They use the public POM provided by Spring Boot or Spring Cloud as the parent, and introduce dependency management.

Step 2: Modify Parent and Dependency Management to Avoid Conflicts with Third-Party Software

Modifying parent and dependency management is a key step to prevent third-party software conflicts.

  1. Determine the Spring Cloud Huawei version, and then query the Spring Boot version and Spring Cloud version corresponding to the Spring Cloud Huawei version. You are advised to use the latest version of Spring Cloud Huawei. You can query the mapping Spring Boot version and Spring Cloud version on the official Spring Cloud Huawei website.
  2. Compare the parent version of the current project with the Spring Boot version and Spring Cloud version that match Spring Cloud Huawei. If the parent version of the current project is earlier, change it to the Spring Cloud Huawei version. Otherwise, no modification is required.
  3. Independently introduce the dependency management of Spring Boot, Spring Cloud, and Spring Cloud Huawei to the dependency management of the current project. If the Spring Boot or Spring Cloud of the original project is of a later version, use the version of the original project. Otherwise, use the Spring Cloud Huawei version. Pay attention to the sequence of dependency management. The dependency management in the front will be used first. Spring Boot and Spring Cloud versions are the basis. You are advised not to provide additional dependency management for the software managed by the two dependencies. You can follow the community version to effectively reduce conflicts. The three dependencies are introduced separately to facilitate the upgrade of a component.
    <dependencyManagement>
        <dependencies>
          <!-- configure user spring cloud / spring boot versions -->
          <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
          <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
          <!-- configure spring cloud huawei version -->
          <dependency>
            <groupId>com.huaweicloud</groupId>
            <artifactId>spring-cloud-huawei-bom</artifactId>
            <version>${spring-cloud-huawei.version}</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>  
    </dependencyManagement>
    If the service system integrates dependencies such as Spring Cloud Alibaba, delete the dependencies from dependency management. You are advised to delete unnecessary dependencies that have been managed by Spring Boot and Spring Cloud. Common dependencies that need to be deleted are as follows:
    <dependencyManagement>
      <dependencies>
        <!-- Dependency of third-party extension -->
        <dependency>
          <groupId>com.alibaba.cloud</groupId>
          <artifactId>spring-cloud-alibaba-dependencies</artifactId>
          <version>2.1.0.RELEASE</version>
          <type>pom</type>
          <scope>import</scope>
          </dependency>
          <!-- Dependency managed by Spring Cloud -->
          <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-feign</artifactId>
            <version>1.4.7.RELEASE</version>
          </dependency>
        </dependencies>
    </dependencyManagement>

Step 3: Add or Delete Dependencies

The components related to service registration and discovery, centralized configuration management, and service governance are added. The third-party implementations of the components are deleted. Other components do not need to be changed. However, after Spring Boot and Spring Cloud are upgraded, these components may need to be upgraded accordingly. Compatibility issues are usually found in the compilation phase or service startup phase.

Generally, you do not need to specify the version number when adding a dependency. The version number is managed by the parent and dependency management.

Introduce the following in microservice applications:

<dependency>
  <groupId>com.huaweicloud</groupId>
  <artifactId>spring-cloud-starter-huawei-service-engine</artifactId>
</dependency>

Introduce the following to the Spring Cloud Gateway application:

<dependency>
  <groupId>com.huaweicloud</groupId>
  <artifactId>spring-cloud-starter-huawei-service-engine-gateway</artifactId>
</dependency>

If the following dependencies exist, delete them:

<!-- Nacos scenario-->
<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
  <groupId>com.alibaba.cloud</groupId>
  <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<dependency>
  <groupId>com.alibaba.csp</groupId>
  <artifactId>spring-cloud-gateway-starter-ahas-sentinel</artifactId>
</dependency>
<dependency>
  <groupId>com.alibaba.csp</groupId>
  <artifactId>spring-boot-starter-ahas-sentinel-client</artifactId>
</dependency>

<!-- Eureka scenario -->
<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

Generally, the following dependencies do not need to be deleted:

<dependency>
  <groupId>com.alibaba</groupId>
  <artifactId>druid</artifactId>
  <version>1.0.28</version>
</dependency>

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback