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

    • Standard Components Overview
    • filter

    • action

      • log
      • functions
      • delay
        • Configuration
        • Relation Type
        • Execution result
        • Configuration example
        • Application example
      • groupAction
      • iterator
      • for
      • exec
      • join
    • transform

    • external

    • flow

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • RuleGo-Server

  • FAQ

  • Endpoint Module

  • Support

目录

delay

delay component: delay component. When the delay period of the message is reached, the message will be deleted from the pending queue and routed to the next node through the success link (Success). If the maximum pending message limit is reached, the messages will be routed through the failure link (Failure). If overwrite is true, the message will be overwritten until the first message is processed, and then it will enter the delay queue again.

Used for timed tasks, scheduling, time-sensitive, delayed execution, peak shaving and other operations.

An example of a delay component

Suppose you have a temperature sensor that sends a telemetry data to RuleGo every second, containing the temperature value and timestamp. You want to trigger an alarm when the temperature exceeds 30 degrees, and clear the alarm when the temperature drops below 25 degrees. But you don't want to trigger and clear alarms frequently, so you set a 10-second delay time, that is, only trigger or clear alarms after the temperature stays above 30 degrees or below 25 degrees for 10 seconds.

At this time, you can configure the delay component: periodInSeconds=10 maxPendingMsgs=1 to achieve this function.

# Configuration

Field Type Description Default value
periodInSeconds int Delay time, in seconds 60
maxPendingMsgs int The maximum number of messages allowed to be pending 1000
periodInSecondsPattern int Get the delay time from the metadata variable by ${metadataKey}, if there is a value, take this value first. None
overwrite bool Whether to overwrite the messages in the period. true: Only one message is kept in the period, and the new message will overwrite the previous message. Until the message in the queue is processed, it will enter the delay queue again. false

# Relation Type

  • Success: After periodInSeconds time, send the message to the Success chain
  • Failure: The number of waiting messages > maxPendingMsgs, send the message to the Failure chain

# Execution result

None

# Configuration example

{
  "id": "s1",
  "type": "delay",
  "name": "Execute delay component",
  "configuration": {
    "periodInSeconds": 1,
    "maxPendingMsgs": 1
  }
}
1
2
3
4
5
6
7
8
9

# Application example

Example reference: Example (opens new window)

Edit this page on GitHub (opens new window)
Last Updated: 2025/04/02, 01:29:50
functions
groupAction

← functions groupAction→

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

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