RuleGo RuleGo
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文
🏠首页
  • 快速入门
  • 规则链
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 可视化
  • RuleGo-Server
  • RuleGo-MCP-Server
  • AOP
  • 触发器
  • 高级主题
  • 性能
  • 标准组件
  • 扩展组件
  • 自定义组件
  • 组件市场
  • 概述
  • 快速入门
  • 路由
  • DSL
  • API
  • Options
  • 组件
🔥编辑器 (opens new window)
  • 可视化编辑器 (opens new window)
  • RuleGo-Server (opens new window)
  • ❓问答

    • FAQ
💖支持
👥加入社区
  • Github (opens new window)
  • Gitee (opens new window)
  • GitCode (opens new window)
  • 更新日志 (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • 快速入门

  • 规则链

  • 标准组件

  • 扩展组件

    • 扩展组件概述
    • 过滤器

    • 转换器

    • 外部的

      • redis客户端
      • kafka客户端
      • nats客户端
      • rabbitmq客户端
      • opengemini写客户端
      • opengemini读客户端
      • MongoDB户端
      • redis发布
      • gRPC客户端
      • OpenTelemetry
      • BeanstalkdWorker
      • BeanstalkdTube
        • 配置
        • 配置示例
        • Relation Type
        • 执行结果
      • WukongimSender
    • AI

    • CI

    • IoT

  • 自定义组件

  • 组件市场

  • 可视化

  • AOP

  • 触发器

  • 高级主题

  • RuleGo-Server

  • 问题

目录

BeanstalkdTube

x/beanstalkdTube组件:v0.29.0+ Beanstalkd生产端,支持以下操作Put、PeekReady、PeekDelayed、PeekBuried、Kick、Stat、Pause。

需要额外引入扩展库:rulego-components (opens new window) 需要配置组件连接复用 (opens new window),不同节点之间通过组件连接复用保持客户端实例一致(Beanstalkd客户端订阅消息后,会锁死当前客户端,其他客户端无法对消息操作)

# 配置

字段 类型 说明 默认值
server string Beanstalkd服务器地址 127.0.0.1:11300
tube string 必填,Tube名称允许使用 ${} 占位符变量 default
cmd string 必填,命令名称,支持Put、PeekReady、PeekDelayed、PeekBuried、Kick、Stat、Pause Stat
body string body消息内容,允许使用 ${} 占位符变量,Put命令参数
pri string 优先级,允许使用 ${} 占位符变量,Put命令参数
delay string 延迟时间,允许使用 ${} 占位符变量,Put命令参数
ttr string Job最大执行秒数, 允许使用 ${} 占位符变量,Put命令参数
kickBound string Kick命令参数bound 允许使用 ${} 占位符变量
pauseTime string Pause命令参数time 允许使用 ${} 占位符变量

# 配置示例

{
"ruleChain": {
"id": "f5G9y8GzpgDY",
"name": "Beanstalkd Node 测试",
"debugMode": false,
"root": true,
"disabled": false,
"additionalInfo": {
"createTime": "2025/01/15 21:50:47",
"description": "",
"layoutX": "700",
"layoutY": "100",
"message": "the rule chain has been disabled",
"updateTime": "2025/01/17 14:31:16",
"username": "admin"
}
},
"metadata": {
"endpoints": [
{
"id": "node_2",
"additionalInfo": {
"layoutX": 450,
"layoutY": 160
},
"type": "endpoint/http",
"name": "API",
"debugMode": false,
"configuration": {
"allowCors": true,
"server": ":6333"
},
"processors": null,
"routers": [
{
"id": "KOUXvKLg1Ml2",
"params": [
"POST"
],
"from": {
"path": "/msg/add",
"configuration": null,
"processors": [
"setJsonDataType"
]
},
"to": {
"path": "f5G9y8GzpgDY:node_4",
"configuration": null,
"wait": true,
"processors": [
"responseToBody",
"metadataToHeaders"
]
}
},
{
"id": "Ud6fjHltHyKg",
"params": [
"POST"
],
"from": {
"path": "/msg/del",
"configuration": null,
"processors": [
"setJsonDataType"
]
},
"to": {
"path": "f5G9y8GzpgDY:node_8",
"configuration": null,
"wait": true,
"processors": [
"responseToBody",
"metadataToHeaders"
]
}
},
{
"id": "HlgiXu67EWBX",
"params": [
"POST"
],
"from": {
"path": "/msg/release",
"configuration": null,
"processors": [
"setJsonDataType"
]
},
"to": {
"path": "f5G9y8GzpgDY:node_15",
"configuration": null,
"wait": true,
"processors": [
"responseToBody"
]
}
}
]
}
],
"nodes": [
{
"id": "node_4",
"additionalInfo": {
"layoutX": 950,
"layoutY": 160
},
"type": "x/beanstalkdTube",
"name": "Put",
"debugMode": true,
"configuration": {
"body": "${msg.body}",
"cmd": "Put",
"putBody": "${msg.body}",
"server": "ref://local_beanstalkdTube",
"tube": "${msg.tube}"
}
},
{
"id": "node_8",
"additionalInfo": {
"layoutX": 900,
"layoutY": 400
},
"type": "x/beanstalkdWorker",
"name": "Del",
"debugMode": true,
"configuration": {
"cmd": "Delete",
"jobId": "${msg.id}",
"server": "ref://local_beanstalkdWorker",
"tube": "${msg.tube}"
}
},
{
"id": "node_13",
"additionalInfo": {
"layoutX": 850,
"layoutY": 550
},
"type": "x/beanstalkdWorker",
"name": "Release",
"debugMode": true,
"configuration": {
"cmd": "Release",
"jobId": "${id}",
"server": "ref://local_beanstalkdWorker",
"tube": "${tube}"
}
},
{
"id": "node_15",
"additionalInfo": {
"layoutX": 500,
"layoutY": 530
},
"type": "x/beanstalkdWorker",
"name": "ReserveJob",
"debugMode": true,
"configuration": {
"cmd": "ReserveJob",
"jobId": "${msg.id}",
"server": "ref://local_beanstalkdWorker",
"tube": "${msg.tube}"
}
}
],
"connections": [
{
"fromId": "node_15",
"toId": "node_13",
"type": "Success"
}
]
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

# Relation Type

  • Success: 执行成功,把消息发送到Success链
  • Failure: 执行失败,把消息发送到Failure链

# 执行结果

参考Beanstkd执行命令返回值,被转换为 RuleMsg 格式并发送到规则链:

  • data:消息内容
  • dataType:JSON
  • type:默认为空
  • metadata:消息元数据,包括 id、tube 等信息
在 GitHub 上编辑此页 (opens new window)
上次更新: 2025/04/02, 01:29:50
BeanstalkdWorker
WukongimSender

← BeanstalkdWorker WukongimSender→

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

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