×

注意!页面内容来自https://github.com/alibaba/spring-cloud-alibaba,本站不储存任何内容,为了更好的阅读体验进行在线解析,若有广告出现,请及时反馈。若您觉得侵犯了您的利益,请通知我们进行删除,然后访问 原网页

Skip to content
<> /* Override primer focus outline color for marketing header dropdown links for better contrast */ [data-color-mode="light"] .HeaderMenu-dropdown-link:focus-visible, [data-color-mode="light"] .HeaderMenu-trailing-link a:focus-visible { outline-color: var(--color-accent-fg); }

alibaba/spring-cloud-alibaba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,644 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Alibaba

CircleCI Maven Central License actions Leaderboard

A project maintained by Alibaba.

See the 中文文档 for Chinese readme.

Spring Cloud Alibaba provides a one-stop solution for distributed application development. It contains all the components required to develop distributed applicationsmaking it easy for you to develop your applications using Spring Cloud.

With Spring Cloud Alibabayou only need to add some annotations and a small amount of configurations to connect Spring Cloud applications to the distributed solutions of Alibabaand build a distributed application system with Alibaba middleware.

Features

  • Flow control and service degradation: Flow control for HTTP services is supported by default. You can also customize flow control and service degradation rules using annotations. The rules can be changed dynamically.
  • Service registration and discovery: Service can be registered and clients can discover the instances using Spring-managed beans. Load balancing is consistent with that supported by the corresponding Spring Cloud.
  • Distributed configuration: Support for externalized configuration in a distributed systemauto refresh when configuration changes.
  • Event-driven: Support for building highly scalable event-driven microservices connected with shared messaging systems.
  • Distributed Transaction: Support for distributed transaction solution with high performance and ease of use.
  • Alibaba Cloud Object Storage: Massivesecurelow-costand highly reliable cloud storage services. Support for storing and accessing any type of data in any applicationanytimeanywhere.
  • Alibaba Cloud SchedulerX: Accuratehighly reliableand highly available scheduled job scheduling services with response time within seconds.
  • Alibaba Cloud SMS: A messaging service that covers the globeAlibaba SMS provides convenientefficientand intelligent communication capabilities that help businesses quickly contact their customers.

For more featuresplease refer to Roadmap.

In addition to the above-mentioned featuresfor the needs of enterprise users' scenariosMicroservices Engine (MSE) of Spring Cloud Alibaba's enterprise version provides an enterprise-level microservices governance centerwhich includes more powerful governance capabilities such as Grayscale ReleaseService Warm-upLossless Online and Offline and Outlier Ejection. At the same timeit also provides a variety of products and solutions such as enterprise-level Nacos registration / configuration centerenterprise-level cloud native gateway.

Components

Sentinel: Sentinel takes "traffic flow" as the breakthrough pointand provides solutions in areas such as flow controlconcurrencycircuit breakingand load protection to protect service stability.

Nacos: An easy-to-use dynamic service discoveryconfiguration and service management platform for building cloud native applications.

RocketMQ: A distributed messaging and streaming platform with low latencyhigh performance and reliabilitytrillion-level capacity and flexible scalability.

Seata: A distributed transaction solution with high performance and ease of use for microservices architecture.

Alibaba Cloud OSS: An encrypted and secure cloud storage service which storesprocesses and accesses massive amounts of data from anywhere in the world.

Alibaba Cloud SMS: A messaging service that covers the globeAlibaba SMS provides convenientefficientand intelligent communication capabilities that help businesses quickly contact their customers.

Alibaba Cloud SchedulerX: Accuratehighly reliableand highly available scheduled job scheduling services with response time within seconds.

For more features please refer to Roadmap.

How to build

  • 2025.1.x branch: Corresponds to Spring Cloud 2025.1.x & Spring Boot 4.0.xJDK 17 or later versions are supported.
  • 2025.0.x branch: Corresponds to Spring Cloud 2025.0.x & Spring Boot 3.5.xJDK 17 or later versions are supported.
  • 2023.x branch: Corresponds to Spring Cloud 2023 & Spring Boot 3.2.xJDK 17 or later versions are supported.
  • 2022.x branch: Corresponds to Spring Cloud 2022 & Spring Boot 3.0.xJDK 17 or later versions are supported.
  • 2021.x branch: Corresponds to Spring Cloud 2021 & Spring Boot 2.6.x. JDK 1.8 or later versions are supported.
  • 2020.0 branch: Corresponds to Spring Cloud 2020 & Spring Boot 2.4.x. JDK 1.8 or later versions are supported.
  • 2.2.x branch: Corresponds to Spring Cloud Hoxton & Spring Boot 2.2.x. JDK 1.8 or later versions are supported.
  • greenwich branch: Corresponds to Spring Cloud Greenwich & Spring Boot 2.1.x. JDK 1.8 or later versions are supported.
  • finchley branch: Corresponds to Spring Cloud Finchley & Spring Boot 2.0.x. JDK 1.8 or later versions are supported.
  • 1.x branch: Corresponds to Spring Cloud Edgware & Spring Boot 1.xJDK 1.7 or later versions are supported.

Spring Cloud uses Maven for most build-related activitiesand you should be able to get off the ground quite quickly by cloning the project you are interested in and typing:

./mvnw install

How to Use

Add maven dependency

Release Version

These artifacts are available from Maven Central and Spring Release repository via BOM:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2025.1.0.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

add the module in dependencies. If you want to choose an older versionyou can refer to the Release Notes.

Snapshot

If you need to use the already published Snapshot Versionadd the following configuration in the dependencyManagement.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2025.1.0.0-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Add the following configuration in repositories.

<repositories>
    <repository>
        <id>github</id>
        <url>https://maven.pkg.github.com/alibaba/spring-cloud-alibaba</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

Add the following configuration in settings.xml.

<servers>
    <server>
        <id>github</id>
        <username>Your GitHub Username</username>
        <password>Your GitHub Token (requires read:packages permission)</password>
    </server>
</servers>

Examples

A spring-cloud-alibaba-examples module is included in our project for you to get started with Spring Cloud Alibaba quickly. It contains an exampleand you can refer to the readme file in the example project for a quick walkthrough.

Examples:

Sentinel Example

Nacos Example

RocketMQ Example

Alibaba Cloud OSS Example

Version control guidelines

The version number of the project is in the form of x.x.xwhere x is a numberstarting from 0and is not limited to the range 0~9. When the project is in the incubator phasethe version number is 0.x.x.

As the interfaces and annotations of Spring Boot 1 and Spring Boot 2 have been changed significantly in the Actuator moduleand spring-cloud-commons is also changed quite a lot from 1.x.x to 2.0.0we take the same version rule as SpringBoot version number.

  • 1.5.x for Spring Boot 1.5.x
  • 2.0.x for Spring Boot 2.0.x
  • 2.1.x for Spring Boot 2.1.x
  • 2.2.x for Spring Boot 2.2.x
  • 2020.x for Spring Boot 2.4.x
  • 2021.x for Spring Boot 2.6.x
  • 2022.x for Spring Boot 3.0.x
  • 2023.x for Spring Boot 3.2.x
  • 2025.0.x for Spring Boot 3.5.x
  • 2025.1.x for Spring Boot 4.0.x

Code of Conduct

This project is a sub-project of Spring Cloudit adheres to the Contributor Covenant code of conduct. By participatingyou are expected to uphold this code. Please report unacceptable behavior to [email protected].

Code Conventions and Housekeeping

None of these is essential for a pull requestbut they will all help. They can also be added after the original pull request but before a merge.

Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the Spring Cloud Build project. If using IntelliJyou can use the Eclipse Code Formatter Plugin to import the same file.

Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying youand preferably at least a paragraph on what the class is for.

Add the ASF license header comment to all new .java files (copy from existing files in the project)

Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes).

Add some Javadocs andif you change the namespacesome XSD doc elements.

A few unit tests would help a lot as well —— someone has to do it.

If no-one else is using your branchplease rebase it against the current 2023.x (or other target branch in the main project).

When writing a commit message please follow these conventionsif you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit message (where XXXX is the issue number).

Contact Us

Mailing list is recommended for discussing almost anything related to spring-cloud-alibaba.

[email protected]: You can ask questions here if you encounter any problem when using or developing spring-cloud-alibaba.