Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ Then declare only the modules you need (versions are managed by the BOM):

| **Branch** | **Spring Cloud compatibility** | **Latest version** |
|------------|----------------------------------------|--------------------|
| `main` | 2022.0.x, 2023.0.x, 2024.0.x, 2025.0.x | `0.2.21` |
| `1.x` | Hoxton, 2020.0.x, 2021.0.x | `0.1.21` |
| `main` | 2022.0.x, 2023.0.x, 2024.0.x, 2025.0.x | `0.2.22` |
| `1.x` | Hoxton, 2020.0.x, 2021.0.x | `0.1.22` |

By default, the `main` branch builds against Spring Cloud 2025.0.x. To build or run tests against an older generation,
activate the corresponding Maven profile:
Expand Down
19 changes: 17 additions & 2 deletions microsphere-spring-cloud-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,35 @@

<dependencies>

<!-- Microsphere Annotation Processor -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-annotation-processor</artifactId>
<optional>true</optional>
</dependency>

<!-- Microsphere Spring Boot Dependencies -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-boot-core</artifactId>
</dependency>

<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-boot-webmvc</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-boot-webflux</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-boot-actuator</artifactId>
<optional>true</optional>
</dependency>

<!-- Spring Boot Dependencies -->
Expand Down Expand Up @@ -132,10 +147,10 @@
<scope>test</scope>
</dependency>

<!-- Microsphere Test -->
<!-- Microsphere Spring Boot Test -->
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-spring-test</artifactId>
<artifactId>microsphere-spring-boot-test</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ReactiveDiscoveryClientAdapter implements DiscoveryClient {
* Create a new {@link ReactiveDiscoveryClientAdapter} that wraps the given
* {@link ReactiveDiscoveryClient} as a blocking {@link DiscoveryClient}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* ReactiveDiscoveryClient reactiveClient = new SimpleReactiveDiscoveryClient(properties);
* DiscoveryClient adapter = new ReactiveDiscoveryClientAdapter(reactiveClient);
Expand All @@ -59,7 +59,7 @@ public ReactiveDiscoveryClientAdapter(ReactiveDiscoveryClient reactiveDiscoveryC
/**
* Delegates to the underlying {@link ReactiveDiscoveryClient#description()} method.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* String desc = adapter.description();
* }</pre>
Expand All @@ -75,7 +75,7 @@ public String description() {
* Returns a blocking list of {@link ServiceInstance} objects for the given service ID
* by collecting results from the underlying {@link ReactiveDiscoveryClient}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* List<ServiceInstance> instances = adapter.getInstances("test-service");
* }</pre>
Expand All @@ -93,7 +93,7 @@ public List<ServiceInstance> getInstances(String serviceId) {
* Returns a blocking list of service names by collecting results from the
* underlying {@link ReactiveDiscoveryClient}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* List<String> services = adapter.getServices();
* }</pre>
Expand All @@ -110,7 +110,7 @@ public List<String> getServices() {
* Delegates to the underlying {@link ReactiveDiscoveryClient#probe()} method to
* verify the discovery client is operational.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* adapter.probe();
* }</pre>
Expand All @@ -123,7 +123,7 @@ public void probe() {
/**
* Returns the order value from the underlying {@link ReactiveDiscoveryClient}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* int order = adapter.getOrder();
* }</pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
/**
* The {@link DiscoveryClient} implementation for a union of the given {@link DiscoveryClient}
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Register UnionDiscoveryClient as a Spring bean, then retrieve merged service instances
* UnionDiscoveryClient unionDiscoveryClient = applicationContext.getBean(UnionDiscoveryClient.class);
Expand All @@ -60,7 +60,7 @@ public final class UnionDiscoveryClient implements DiscoveryClient, ApplicationC
/**
* Returns a human-readable description of this {@link DiscoveryClient}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* String desc = unionDiscoveryClient.description();
* }</pre>
Expand All @@ -76,7 +76,7 @@ public String description() {
* Returns a merged list of {@link ServiceInstance} objects from all registered
* {@link DiscoveryClient} instances for the given service ID.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* List<ServiceInstance> instances = unionDiscoveryClient.getInstances("test");
* }</pre>
Expand All @@ -101,7 +101,7 @@ public List<ServiceInstance> getInstances(String serviceId) {
* Returns a deduplicated list of service names from all registered {@link DiscoveryClient}
* instances, preserving insertion order.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* List<String> services = unionDiscoveryClient.getServices();
* }</pre>
Expand All @@ -126,7 +126,7 @@ public List<String> getServices() {
* {@link CompositeDiscoveryClient} and this instance itself. The list is lazily initialized
* from the {@link ApplicationContext} on first access and cached for subsequent calls.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* UnionDiscoveryClient unionClient = applicationContext.getBean(UnionDiscoveryClient.class);
* List<DiscoveryClient> clients = unionClient.getDiscoveryClients();
Expand Down Expand Up @@ -158,7 +158,7 @@ public List<DiscoveryClient> getDiscoveryClients() {
* Returns the order value of this client. This client uses {@code HIGHEST_PRECEDENCE}
* to ensure it takes priority over other {@link DiscoveryClient} implementations.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* int order = unionDiscoveryClient.getOrder();
* }</pre>
Expand All @@ -174,7 +174,7 @@ public int getOrder() {
* Callback invoked after all singleton beans have been instantiated. Eagerly initializes
* the internal list of {@link DiscoveryClient} instances.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Automatically called by the Spring container after singleton initialization
* unionDiscoveryClient.afterSingletonsInstantiated();
Expand All @@ -188,7 +188,7 @@ public void afterSingletonsInstantiated() {
/**
* Clears the cached list of {@link DiscoveryClient} instances when this bean is destroyed.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Automatically called by the Spring container on shutdown
* unionDiscoveryClient.destroy();
Expand All @@ -204,7 +204,7 @@ public void destroy() throws Exception {
/**
* Sets the {@link ApplicationContext} used to look up {@link DiscoveryClient} beans.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Automatically called by the Spring container
* unionDiscoveryClient.setApplicationContext(applicationContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static class UnionConfiguration {
* Creates a {@link UnionDiscoveryClient} bean that aggregates all {@link DiscoveryClient}
* instances in the {@link org.springframework.context.ApplicationContext}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Activated when microsphere.spring.cloud.client.discovery.mode=union
* UnionDiscoveryClient client = applicationContext.getBean(UnionDiscoveryClient.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static class BlockingConfiguration {
* Creates a {@link ReactiveDiscoveryClientAdapter} bean that adapts a
* {@link ReactiveDiscoveryClient} to the blocking {@link org.springframework.cloud.client.discovery.DiscoveryClient} interface.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* // Auto-configured when both reactive and blocking discovery are enabled
* DiscoveryClient client = applicationContext.getBean(ReactiveDiscoveryClientAdapter.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class InMemoryServiceRegistry implements ServiceRegistry {
* Registers the given {@link Registration} instance in the in-memory storage,
* keyed by its instance ID.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* Registration registration = createRegistration();
Expand All @@ -58,7 +58,7 @@ public void register(Registration registration) {
/**
* Removes the given {@link Registration} instance from the in-memory storage.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* Registration registration = createRegistration();
Expand All @@ -77,7 +77,7 @@ public void deregister(Registration registration) {
/**
* Closes this registry by clearing all stored {@link Registration} instances.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* registry.register(registration);
Expand All @@ -93,7 +93,7 @@ public void close() {
* Sets the status of the given {@link Registration} by storing it in
* the registration's metadata under the {@code _status_} key.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* registry.register(registration);
Expand All @@ -114,7 +114,7 @@ public void setStatus(Registration registration, String status) {
/**
* Retrieves the status of the given {@link Registration} from its metadata.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* registry.register(registration);
Expand All @@ -138,7 +138,7 @@ public Object getStatus(Registration registration) {
* Retrieves the metadata {@link Map} for the given {@link Registration}
* from the in-memory storage.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* InMemoryServiceRegistry registry = new InMemoryServiceRegistry();
* registry.register(registration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class MultipleAutoServiceRegistration extends AbstractAutoServiceRegistra
* {@link MultipleRegistration}, {@link ServiceRegistry}, and
* {@link AutoServiceRegistrationProperties}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* MultipleRegistration registration = new MultipleRegistration(registrations);
* ServiceRegistry<MultipleRegistration> serviceRegistry = new InMemoryServiceRegistry();
Expand All @@ -50,7 +50,7 @@ public MultipleAutoServiceRegistration(MultipleRegistration multipleRegistration
* Returns the configuration object for this auto service registration.
* This implementation always returns {@code null}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* MultipleAutoServiceRegistration autoReg = ...;
* Object config = autoReg.getConfiguration(); // null
Expand All @@ -67,7 +67,7 @@ protected Object getConfiguration() {
* Determines whether this auto service registration is enabled based on the
* {@link AutoServiceRegistrationProperties}.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* MultipleAutoServiceRegistration autoReg = ...;
* boolean enabled = autoReg.isEnabled();
Expand All @@ -83,7 +83,7 @@ protected boolean isEnabled() {
/**
* Returns the {@link MultipleRegistration} managed by this auto service registration.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* MultipleAutoServiceRegistration autoReg = ...;
* MultipleRegistration registration = autoReg.getRegistration();
Expand All @@ -100,7 +100,7 @@ protected MultipleRegistration getRegistration() {
* Returns the management {@link MultipleRegistration}, which is the same as
* the primary registration in this implementation.
*
* <p>Example Usage:
* <h3>Example Usage</h3>
* <pre>{@code
* MultipleAutoServiceRegistration autoReg = ...;
* MultipleRegistration mgmtRegistration = autoReg.getManagementRegistration();
Expand Down
Loading
Loading