Skip to content

Commit 72d32aa

Browse files
authored
Merge pull request #68 from microsphere-projects/dev
Release 0.2.1
2 parents 2b6a4c1 + 565bbc5 commit 72d32aa

File tree

104 files changed

+4174
-954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4174
-954
lines changed

.github/workflows/maven-build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,17 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
java: [ '17' , '21' ]
23-
maven-profile-spring-cloud: [ 'spring-cloud-2022' , 'spring-cloud-2023' , 'spring-cloud-2024' ]
22+
java: [ '17' , '21' , '25' ]
23+
maven-profile-spring-cloud: [ 'spring-cloud-2022' , 'spring-cloud-2023' , 'spring-cloud-2024' , 'spring-cloud-2025' ]
2424
steps:
2525
- name: Checkout Source
2626
uses: actions/checkout@v4
2727

28+
- name: Setup Testcontainers Cloud Client
29+
uses: atomicjar/testcontainers-cloud-setup-action@v1
30+
with:
31+
token: ${{ secrets.TC_CLOUD_TOKEN }}
32+
2833
- name: Setup JDK ${{ matrix.Java }}
2934
uses: actions/setup-java@v4
3035
with:
@@ -39,7 +44,7 @@ jobs:
3944
--file pom.xml
4045
-Drevision=0.0.1-SNAPSHOT
4146
test
42-
--activate-profiles test,coverage,${{ matrix.maven-profile-spring-cloud }}
47+
--activate-profiles test,coverage,testcontainers,${{ matrix.maven-profile-spring-cloud }}
4348

4449
- name: Upload coverage reports to Codecov
4550
uses: codecov/codecov-action@v5

.github/workflows/maven-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
jobs:
2222
build:
2323
runs-on: ubuntu-latest
24-
if: ${{ inputs.revision }}
24+
if: ${{ inputs.revision }}
2525
steps:
2626
- name: Checkout Source
2727
uses: actions/checkout@v4
@@ -48,6 +48,6 @@ jobs:
4848
env:
4949
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
5050
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
51-
SIGN_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID_LONG }}
51+
SIGN_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID_LONG }}
5252
SIGN_KEY: ${{ secrets.OSS_SIGNING_KEY }}
5353
SIGN_KEY_PASS: ${{ secrets.OSS_SIGNING_PASSWORD }}

CODE_OF_CONDUCT.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of
4+
fostering an open and welcoming community, we pledge to respect all people who
5+
contribute through reporting issues, posting feature requests, updating
6+
documentation, submitting pull requests or patches, and other activities.
7+
8+
We are committed to making participation in this project a harassment-free
9+
experience for everyone, regardless of level of experience, gender, gender
10+
identity and expression, sexual orientation, disability, personal appearance,
11+
body size, race, ethnicity, age, religion, or nationality.
12+
13+
Examples of unacceptable behavior by participants include:
14+
15+
* The use of sexualized language or imagery
16+
* Personal attacks
17+
* Trolling or insulting/derogatory comments
18+
* Public or private harassment
19+
* Publishing other's private information, such as physical or electronic
20+
addresses, without explicit permission
21+
* Other unethical or unprofessional conduct
22+
23+
Project maintainers have the right and responsibility to remove, edit, or
24+
reject comments, commits, code, wiki edits, issues, and other contributions
25+
that are not aligned to this Code of Conduct, or to ban temporarily or
26+
permanently any contributor for other behaviors that they deem inappropriate,
27+
threatening, offensive, or harmful.
28+
29+
By adopting this Code of Conduct, project maintainers commit themselves to
30+
fairly and consistently applying these principles to every aspect of managing
31+
this project. Project maintainers who do not follow or enforce the Code of
32+
Conduct may be permanently removed from the project team.
33+
34+
This Code of Conduct applies both within project spaces and in public spaces
35+
when an individual is representing the project or its community.
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
38+
reported by contacting a project maintainer at [mercyblitz@gmail.com](mailto:mercyblitz@gmail.com). All
39+
complaints will be reviewed and investigated and will result in a response that
40+
is deemed necessary and appropriate to the circumstances. Maintainers are
41+
obligated to maintain confidentiality with regard to the reporter of an
42+
incident.
43+
44+
45+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
46+
version 1.3.0, available at https://www.contributor-covenant.org/version/1/3/0/code-of-conduct.html
47+
48+
[homepage]: https://www.contributor-covenant.org

README.md

Lines changed: 134 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,144 @@
11
# Microsphere Spring Cloud
22

3-
Microsphere Projects for Spring Cloud
3+
> Microsphere Projects for Spring Cloud
44
5+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/microsphere-projects/microsphere-spring-cloud)
6+
[![zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYgNS42MDAxSDQuOTYxNTZDNS4zMTUwMiA1LjYwMDEgNS42MDE1NiA1LjMxMzU2IDUuNjAxNTYgNC45NjAxVjIuMjQwMUM1LjYwMTU2IDEuODg2NjQgNS4zMTUwMiAxLjYwMDEgNC45NjE1NiAxLjYwMDFaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00Ljk2MTU2IDEwLjM5OTlIMi4yNDE1NkMxLjg4ODEgMTAuMzk5OSAxLjYwMTU2IDEwLjY4NjQgMS42MDE1NiAxMS4wMzk5VjEzLjc1OTlDMS42MDE1NiAxNC4xMTM0IDEuODg4MSAxNC4zOTk5IDIuMjQxNTYgMTQuMzk5OUg0Ljk2MTU2QzUuMzE1MDIgMTQuMzk5OSA1LjYwMTU2IDE0LjExMzQgNS42MDE1NiAxMy43NTk5VjExLjAzOTlDNS42MDE1NiAxMC42ODY0IDUuMzE1MDIgMTAuMzk5OSA0Ljk2MTU2IDEwLjM5OTlaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik0xMy43NTg0IDEuNjAwMUgxMS4wMzg0QzEwLjY4NSAxLjYwMDEgMTAuMzk4NCAxLjg4NjY0IDEwLjM5ODQgMi4yNDAxVjQuOTYwMUMxMC4zOTg0IDUuMzEzNTYgMTAuNjg1IDUuNjAwMSAxMS4wMzg0IDUuNjAwMUgxMy43NTg0QzE0LjExMTkgNS42MDAxIDE0LjM5ODQgNS4zMTM1NiAxNC4zOTg0IDQuOTYwMVYyLjI0MDFDMTQuMzk4NCAxLjg4NjY0IDE0LjExMTkgMS42MDAxIDEzLjc1ODQgMS42MDAxWiIgZmlsbD0iI2ZmZiIvPgo8cGF0aCBkPSJNNCAxMkwxMiA0TDQgMTJaIiBmaWxsPSIjZmZmIi8%2BCjxwYXRoIGQ9Ik00IDEyTDEyIDQiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgo8L3N2Zz4K&logoColor=ffffff)](https://zread.ai/microsphere-projects/microsphere-spring-cloud)
57
[![Maven Build](https://github.com/microsphere-projects/microsphere-spring-cloud/actions/workflows/maven-build.yml/badge.svg)](https://github.com/microsphere-projects/microsphere-spring-cloud/actions/workflows/maven-build.yml)
68
[![Codecov](https://codecov.io/gh/microsphere-projects/microsphere-spring-cloud/branch/dev/graph/badge.svg)](https://app.codecov.io/gh/microsphere-projects/microsphere-spring-cloud)
79
![Maven](https://img.shields.io/maven-central/v/io.github.microsphere-projects/microsphere-spring-cloud.svg)
810
![License](https://img.shields.io/github/license/microsphere-projects/microsphere-spring-cloud.svg)
911
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/microsphere-projects/microsphere-spring-cloud.svg)](http://isitmaintained.com/project/microsphere-projects/microsphere-spring-cloud "Average time to resolve an issue")
1012
[![Percentage of issues still open](http://isitmaintained.com/badge/open/microsphere-projects/microsphere-spring-cloud.svg)](http://isitmaintained.com/project/microsphere-projects/microsphere-spring-cloud "Percentage of issues still open")
1113

14+
Microsphere Spring Cloud is an extension library for Spring Cloud that enhances and optimizes its capabilities,
15+
particularly focused on providing dynamic runtime configuration changes without application restarts. It's designed to
16+
solve common pain points when working with distributed systems in Spring Cloud.
17+
18+
## Purpose and Scope
19+
20+
Microsphere Spring Cloud is a comprehensive extension framework that enhances Spring Cloud applications with advanced
21+
service registration capabilities, dynamic OpenFeign client configuration, and fault tolerance features. This project
22+
provides production-ready enhancements to the core Spring Cloud ecosystem, focusing on operational reliability and
23+
dynamic configuration management.
24+
25+
The framework supports multiple Spring Cloud versions (2022.x, 2023.x, 2024.x and 2025.x) and integrates seamlessly with
26+
various
27+
service discovery systems including Nacos, Eureka, Consul, and Zookeeper. For detailed information about specific
28+
subsystems, see Project Structure, Service Registration System, OpenFeign Auto-Refresh System, and Fault Tolerance.
29+
30+
## Modules
31+
32+
| **Module** | **Purpose** |
33+
|-------------------------------------------|-------------------------------------------------------------------------------------|
34+
| **microsphere-spring-cloud-parent** | Defines the parent POM with dependency management and Spring Cloud version profiles |
35+
| **microsphere-spring-cloud-dependencies** | Centralizes dependency management for all project modules |
36+
| **microsphere-spring-cloud-commons** | Common utilities for service discovery, registry, and fault tolerance |
37+
| **microsphere-spring-cloud-openfeign** | Extensions for Spring Cloud OpenFeign with auto-refresh capabilities |
38+
39+
## Getting Started
40+
41+
The easiest way to get started is by adding the Microsphere Spring Cloud BOM (Bill of Materials) to your project's
42+
pom.xml:
43+
44+
```xml
45+
<dependencyManagement>
46+
<dependencies>
47+
...
48+
<!-- Microsphere Spring Cloud Dependencies -->
49+
<dependency>
50+
<groupId>io.github.microsphere-projects</groupId>
51+
<artifactId>microsphere-spring-cloud-dependencies</artifactId>
52+
<version>${microsphere-spring-cloud.version}</version>
53+
<type>pom</type>
54+
<scope>import</scope>
55+
</dependency>
56+
...
57+
</dependencies>
58+
</dependencyManagement>
59+
```
60+
61+
`${microsphere-spring-boot.version}` has two branches:
62+
63+
| **Branches** | **Purpose** | **Latest Version** |
64+
|--------------|--------------------------------------------------|--------------------|
65+
| **0.2.x** | Compatible with Spring Cloud 2022.0.x - 2025.0.x | 0.2.1 |
66+
| **0.1.x** | Compatible with Spring Cloud Hoxton - 2021.0.x | 0.1.1 |
67+
68+
Then add the specific modules you need:
69+
70+
```xml
71+
<dependencies>
72+
<!-- Microsphere Spring Cloud Commons -->
73+
<dependency>
74+
<groupId>io.github.microsphere-projects</groupId>
75+
<artifactId>microsphere-spring-cloud-commons</artifactId>
76+
</dependency>
77+
78+
<!-- Microsphere Spring Cloud OpenFeign -->
79+
<dependency>
80+
<groupId>io.github.microsphere-projects</groupId>
81+
<artifactId>microsphere-spring-cloud-openfeign</artifactId>
82+
</dependency>
83+
</dependencies>
84+
```
85+
86+
## Building from Source
87+
88+
You don't need to build from source unless you want to try out the latest code or contribute to the project.
89+
90+
To build the project, follow these steps:
91+
92+
1. Clone the repository:
93+
94+
```bash
95+
git clone https://github.com/microsphere-projects/microsphere-spring-cloud.git
96+
```
97+
98+
2. Build the source:
99+
100+
- Linux/MacOS:
101+
102+
```bash
103+
./mvnw package
104+
```
105+
106+
- Windows:
107+
108+
```powershell
109+
mvnw.cmd package
110+
```
111+
112+
## Contributing
113+
114+
We welcome your contributions! Please read [Code of Conduct](./CODE_OF_CONDUCT.md) before submitting a pull request.
115+
116+
## Reporting Issues
117+
118+
* Before you log a bug, please search
119+
the [issues](https://github.com/microsphere-projects/microsphere-spring-cloud/issues)
120+
to see if someone has already reported the problem.
121+
* If the issue doesn't already
122+
exist, [create a new issue](https://github.com/microsphere-projects/microsphere-spring-cloud/issues/new).
123+
* Please provide as much information as possible with the issue report.
124+
125+
## Documentation
126+
127+
### User Guide
128+
129+
[DeepWiki Host](https://deepwiki.com/microsphere-projects/microsphere-spring-cloud)
130+
131+
[ZRead Host](https://zread.ai/microsphere-projects/microsphere-spring-cloud)
132+
133+
### Wiki
134+
135+
[Github Host](https://github.com/microsphere-projects/microsphere-spring-cloud/wiki)
136+
137+
### JavaDoc
138+
139+
- [microsphere-spring-cloud-commons](https://javadoc.io/doc/io.github.microsphere-projects/microsphere-spring-cloud-commons)
140+
- [microsphere-spring-cloud-openfeign](https://javadoc.io/doc/io.github.microsphere-projects/microsphere-spring-cloud-openfeign)
141+
142+
## License
143+
144+
The Microsphere Spring is released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

microsphere-spring-cloud-commons/pom.xml

Lines changed: 52 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,52 @@
6767
<optional>true</optional>
6868
</dependency>
6969

70+
71+
<!-- Netflix Eureka Client -->
72+
<dependency>
73+
<groupId>org.springframework.cloud</groupId>
74+
<artifactId>spring-cloud-netflix-eureka-client</artifactId>
75+
<optional>true</optional>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>com.netflix.eureka</groupId>
80+
<artifactId>eureka-client</artifactId>
81+
<optional>true</optional>
82+
</dependency>
83+
84+
<!-- Alibaba Nacos Discovery -->
85+
<dependency>
86+
<groupId>com.alibaba.cloud</groupId>
87+
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
88+
<optional>true</optional>
89+
</dependency>
90+
91+
<!-- Spring Cloud Zookeeper -->
92+
<dependency>
93+
<groupId>org.springframework.cloud</groupId>
94+
<artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
95+
<optional>true</optional>
96+
</dependency>
97+
98+
<!-- Spring Cloud Consul -->
99+
<dependency>
100+
<groupId>org.springframework.cloud</groupId>
101+
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
102+
<optional>true</optional>
103+
</dependency>
104+
70105
<!-- Microsphere Dependencies -->
71106
<dependency>
72107
<groupId>io.github.microsphere-projects</groupId>
73108
<artifactId>microsphere-spring-boot-core</artifactId>
74109
</dependency>
75110

111+
<dependency>
112+
<groupId>io.github.microsphere-projects</groupId>
113+
<artifactId>microsphere-spring-boot-actuator</artifactId>
114+
</dependency>
115+
76116
<dependency>
77117
<groupId>io.github.microsphere-projects</groupId>
78118
<artifactId>microsphere-spring-webmvc</artifactId>
@@ -92,31 +132,24 @@
92132
<scope>test</scope>
93133
</dependency>
94134

95-
<!-- Testcontainers -->
96-
<dependency>
97-
<groupId>org.testcontainers</groupId>
98-
<artifactId>junit-jupiter</artifactId>
99-
<scope>test</scope>
100-
</dependency>
101-
102-
<!-- Netflix Eureka Client -->
103-
<dependency>
104-
<groupId>org.springframework.cloud</groupId>
105-
<artifactId>spring-cloud-netflix-eureka-client</artifactId>
106-
<scope>test</scope>
107-
</dependency>
108-
135+
<!-- Microsphere Test -->
109136
<dependency>
110-
<groupId>com.netflix.eureka</groupId>
111-
<artifactId>eureka-client</artifactId>
137+
<groupId>io.github.microsphere-projects</groupId>
138+
<artifactId>microsphere-spring-test</artifactId>
112139
<scope>test</scope>
113140
</dependency>
114141

115-
<!-- Alibaba Nacos Discovery -->
142+
<!-- Testcontainers -->
116143
<dependency>
117-
<groupId>com.alibaba.cloud</groupId>
118-
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
144+
<groupId>org.testcontainers</groupId>
145+
<artifactId>testcontainers-junit-jupiter</artifactId>
119146
<scope>test</scope>
147+
<exclusions>
148+
<exclusion>
149+
<groupId>junit</groupId>
150+
<artifactId>junit</artifactId>
151+
</exclusion>
152+
</exclusions>
120153
</dependency>
121154

122155
</dependencies>

microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/condition/ConditionalOnFeaturesEnabled.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
import org.springframework.core.annotation.AliasFor;
2525

2626
import java.lang.annotation.Documented;
27-
import java.lang.annotation.ElementType;
2827
import java.lang.annotation.Retention;
29-
import java.lang.annotation.RetentionPolicy;
3028
import java.lang.annotation.Target;
3129

3230
import static io.microsphere.spring.cloud.commons.constants.CommonsPropertyConstants.FEATURES_ENABLED_PROPERTY_NAME;
31+
import static java.lang.annotation.ElementType.METHOD;
32+
import static java.lang.annotation.ElementType.TYPE;
33+
import static java.lang.annotation.RetentionPolicy.RUNTIME;
3334

3435
/**
3536
* The conditional annotation meta-annotates {@link ConditionalOnProperty @ConditionalOnProperty} for
@@ -43,8 +44,8 @@
4344
* @see ConditionalOnProperty
4445
* @since 1.0.0
4546
*/
46-
@Retention(RetentionPolicy.RUNTIME)
47-
@Target({ElementType.TYPE, ElementType.METHOD})
47+
@Retention(RUNTIME)
48+
@Target({TYPE, METHOD})
4849
@Documented
4950
@ConditionalOnProperty(name = FEATURES_ENABLED_PROPERTY_NAME)
5051
public @interface ConditionalOnFeaturesEnabled {

0 commit comments

Comments
 (0)