-
Notifications
You must be signed in to change notification settings - Fork 11
io microsphere alibaba sentinel spring boot condition ConditionalOnSentinelAvailable
github-actions[bot] edited this page Jul 5, 2026
·
2 revisions
Type: Annotation | Module: microsphere-alibaba-sentinel-spring-boot | Package: io.microsphere.alibaba.sentinel.spring.boot.condition | Since: 1.0.0
Indicates that a component is eligible for registration when Alibaba Sentinel is available.
This annotation combines ConditionalOnSentinelEnabled @ConditionalOnSentinelEnabled and
ConditionalOnClass @ConditionalOnClass(name = {"com.alibaba.csp.sentinel.SphU" , "io.microsphere.alibaba.sentinel.common.SentinelPlugin")}, meaning the annotated component will be registered
only if Sentinel is explicitly enabled and the Sentinel core classes are present on the classpath.
{@code
### Declaration
```java
public @interface ConditionalOnSentinelAvailable
```
**Author:** Mercy
## Version Information
- **Introduced in:** `1.0.0`
- **Current Project Version:** `0.2.0-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
@ConditionalOnSentinelAvailiable
public class MySentinelConfiguration {
// This configuration will only be active if Sentinel is available
}
```
## Usage
### Maven Dependency
Add the following dependency to your `pom.xml`:
```xml
io.github.microsphere-projects
microsphere-alibaba-sentinel-spring-boot
${microsphere-alibaba-sentinel.version}
```
> **Tip:** Use the BOM (`microsphere-alibaba-sentinel-dependencies`) for consistent version management. See the [Getting Started](https://github.com/microsphere-projects/microsphere-alibaba-sentinel#getting-started) guide.
### Import
```java
import io.microsphere.alibaba.sentinel.spring.boot.condition.ConditionalOnSentinelAvailable;
```
## See Also
- `SentinelRedisAutoConfiguration`
---
*This documentation was auto-generated from the source code of [microsphere-alibaba-sentinel](https://github.com/microsphere-projects/microsphere-alibaba-sentinel).*
alibaba-sentinel-commons
- AbstractSentinelPlugin
- JMXSentinelPluginRepository
- SentinelConstants
- SentinelContext
- SentinelOperations
- SentinelPlugin
- SentinelPluginRepository
- SentinelTemplate
- SentinelUtils
- SimpleSentinelPlugin
- SimpleSentinelPluginRepository
alibaba-sentinel-spring-boot
- ConditionalOnSentinelAvailable
- ConditionalOnSentinelEnabled
- SentinelAlibabaDruidAutoConfiguration
- SentinelMyBatisAutoConfiguration
- SentinelRedisAutoConfiguration
- SentinelSpringWebAutoConfiguration
alibaba-sentinel-spring-cloud