Skip to content

io microsphere spring cloud gateway server webflux annotation ConditionalOnGatewayAvailable

github-actions[bot] edited this page Jul 9, 2026 · 1 revision

ConditionalOnGatewayAvailable

Type: Annotation | Module: microsphere-spring-cloud-gateway-server-webflux | Package: io.microsphere.spring.cloud.gateway.server.webflux.annotation | Since: 1.0.0

Source: microsphere-spring-cloud-gateway-server-webflux/src/main/java/io/microsphere/spring/cloud/gateway/server/webflux/annotation/ConditionalOnGatewayAvailable.java

Overview

Indicates that the annotated element is only available when Spring Cloud Gateway is available.

Example Usage

Example usage on a configuration class:

{@code

### Declaration

```java
public @interface ConditionalOnGatewayAvailable
```

## Version Information

- **Introduced in:** `1.0.0`
- **Current Project Version:** `0.2.14-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

### Example 1

```java
@Configuration
@ConditionalOnGatewayAvailable
public class MyGatewayConfig {
    // ...
}
```

### Example 2

```java
@Bean
@ConditionalOnGatewayAvailable
public MyCustomFilter myCustomFilter() {
    return new MyCustomFilter();
}
```

## Usage

### Maven Dependency

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

```xml

    io.github.microsphere-projects
    microsphere-spring-cloud-gateway-server-webflux
    ${microsphere-gateway.version}

```

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

### Import

```java
import io.microsphere.spring.cloud.gateway.server.webflux.annotation.ConditionalOnGatewayAvailable;
```

## See Also

- `ConditionalOnGatewayEnabled`
- `ConditionalOnProperty`
- `ConditionalOnClass`
- `org.springframework.cloud.gateway.config.GatewayProperties`

---

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

Clone this wiki locally