RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

    • AOP Overview
    • Before Advice
    • After Advice
    • Around Advice
    • Start Advice
    • End Advice
    • Completed Advice
    • OnChainBeforeInit Advice
    • OnNodeBeforeInit 增强点
    • OnCreated Advice
    • OnReload Advice
    • OnDestroy Advice
    • builtin aspect

      • Debug Aspect
      • Fallback Aspect
        • Configuration
        • Usage example
      • Metrics Aspect
      • Concurrency Limiter Aspect
      • RuleChain Validator Aspect
  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

Fallback Aspect

Fallback Aspect: Node fault degradation aspect, is a built-in aspect of the system. If the node fails to execute (relationType="Failure") more than a certain threshold within a certain time, then it will trigger component fault degradation, skip the component, and connect the next node through Failure RelationType, error content: skip fallback error

Node fault degradation aspect, for nodes such as restApiCall, mqttClient that interact with external services, when the external service is not available, using node degradation can protect system resources well.

TIP

This aspect needs to be manually imported.

# Configuration

Field Type Description Default
ErrorCountLimit int After the number of errors reaches a certain limit within LimitDuration, skip degradation is executed 0
LimitDuration time.Duration The duration of the degradation limit None
PointCutFunc func(ctx types.RuleContext, msg types.RuleMsg, relationType string) bool Used to determine whether to execute degradation logic, default all true

# Usage example

Reference example (opens new window)

//If 3 errors occur within 60s, skip the current node and continue to execute the next node, and resume after 60s
types.WithAspects(
  &aspect.SkipFallbackAspect{
      ErrorCountLimit: 3,
      LimitDuration: time.Second * 60}
)
1
2
3
4
5
6
Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
Debug Aspect
Metrics Aspect

← Debug Aspect Metrics Aspect→

Theme by Vdoing | Copyright © 2023-2025 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式