Skip to content

io microsphere spring cloud client discovery condition ConditionalOnReactiveDiscoveryAvailable

github-actions[bot] edited this page Jun 10, 2026 · 1 revision

ConditionalOnReactiveDiscoveryAvailable

Type: Annotation | Module: microsphere-spring-cloud-commons | Package: io.microsphere.spring.cloud.client.discovery.condition | Since: 1.0.0

Source: microsphere-spring-cloud-commons/src/main/java/io/microsphere/spring/cloud/client/discovery/condition/ConditionalOnReactiveDiscoveryAvailable.java

Overview

ConditionalOnReactiveDiscoveryEnabled and ConditionalOnClass for Reactive Discovery Client.

This annotation can be used to conditionally enable a bean or configuration only when:

- The Spring Cloud Discovery is enabled (`ConditionalOnDiscoveryEnabled`).
- The Reactive Discovery is explicitly enabled (`ConditionalOnReactiveDiscoveryEnabled`).
- The Reactive Discovery Client class is present on the classpath.

Example Usage:

{@code

### Declaration

```java
public @interface ConditionalOnReactiveDiscoveryAvailable
```

**Author:** Mercy

## Version Information

- **Introduced in:** `1.0.0`
- **Current Project Version:** `0.2.18-SNAPSHOT`

## Version Compatibility

This component is tested and compatible with the following Java versions:

| Java Version | Status |
|:---:|:---:|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |

## Examples

```java
@Configuration
public class ReactiveDiscoveryConfig {

    @Bean
    @ConditionalOnReactiveDiscoveryAvailable
    public MyReactiveService myReactiveService(ReactiveDiscoveryClient client) {
        return new MyReactiveService(client);
    }
}
```

## Usage

### Maven Dependency

Add the following dependency to your `pom.xml`:

```xml

    io.github.microsphere-projects
    microsphere-spring-cloud-commons
    ${microsphere-spring-cloud.version}

```

> **Tip:** Use the BOM (`microsphere-spring-cloud-dependencies`) for consistent version management. See the [Getting Started](https://github.com/microsphere-projects/microsphere-spring-cloud#getting-started) guide.

### Import

```java
import io.microsphere.spring.cloud.client.discovery.condition.ConditionalOnReactiveDiscoveryAvailable;
```

---

*This documentation was auto-generated from the source code of [microsphere-spring-cloud](https://github.com/microsphere-projects/microsphere-spring-cloud).*

Home

spring-cloud-commons

spring-cloud-openfeign

Clone this wiki locally