How huaweicloud/spring-cloud-huawei works
Main Components
• Core Framework Modules: These include the “spring-cloud-huawei-common” for shared utilities and core configurations.
• Governance & Discovery Modules: Separate modules exist for service discovery/registration and configuration management. For example, the “spring-cloud-huawei-governance” and the discovery modules organized around ServiceComb (CSE) and Nacos. Also, modules like “spring-cloud-huawei-nacos” and “spring-cloud-huawei-service-engine” have their own responsibilities.
• Mesh and Routing Support: Modules like “spring-cloud-huawei-mesh” and “spring-cloud-huawei-router” handle different aspects of service mesh, load balancing, and dynamic routing.
• Starter/Auto-configuration Modules: The “spring-cloud-starter-huawei” set of modules simplify application integration by providing auto-configuration and dependency management.
• Documentation/Swagger Support: “spring-cloud-huawei-swagger” helps in generating API documentation (with a noted switch from springfox to springdoc on newer versions).
Relationships and Interactions
• Dependency and Auto-Configuration: The starter modules depend on the core modules. They automatically wire in the necessary beans (from governance, discovery, common utilities, etc.) into a Spring Boot environment.
Architectural Patterns and Design Principles
• Modular Architecture: The project is organized into many small, purpose-specific modules. Emphasize how these modules encapsulate functionality (for example, common utilities, governance, service engine, mesh) and how they are assembled together in the auto-configuration process.
• Spring Boot Auto-Configuration: Several modules work as starters that rely on Spring Boot’s auto-configuration mechanism, reducing the need for manual configuration.
Relevant Technologies and Frameworks
• Maven multi-module project structure
• Spring Boot and Spring Cloud underlying the auto-configuration
• Integration with Apache ServiceComb and Nacos for discovery/registration and configuration
• Tools for governance (circuit breakers, load balancers) and Swagger support for API documentation
• Supporting testing infrastructure (integration-tests directory) which reinforces modular unit testing and end-to-end test flows
• Decompose the Core Framework into its key modules (common, governance, mesh, starters, discovery – divided into ServiceComb and Nacos paths).
• The a multi-layer design (client, framework core, external services).
• The modular subcomponents (common, governance, mesh, configuration, discovery, auto-config/starter, swagger).
• The choices and integrations for using ServiceComb (CSE) versus Nacos.