feat: 切换定时任务至分布式调度底座

- 以执行账本和有界 Worker 承载重负载任务与故障接管

- 接入统一调度 Starter 并增加 MySQL 迁移、指标和回归测试
This commit is contained in:
2026-08-31 14:57:08 +08:00
parent 17ef189862
commit 8c174e5c02
66 changed files with 5348 additions and 545 deletions

View File

@@ -25,7 +25,8 @@ spring:
username: root
password: root
hikari:
maximum-pool-size: 12
# 调度管理 Saga 会同时占用业务事务和 Quartz JobStore 连接;容量由启动校验守护。
maximum-pool-size: 24
minimum-idle: 2
connection-timeout: 5000
validation-timeout: 3000
@@ -59,34 +60,65 @@ spring:
# 静态资源路径,用于访问本地文件
# 注意,这里要和下面的 easyflow.storage.local.prefix 后面的路径 /attachment 保持一致!
static-path-pattern: /attachment/**
# quartz 相关配置
quartz:
startup-delay: 1
job-store-type: jdbc
jdbc:
platform: mysql
initialize-schema: never
properties:
org:
quartz:
scheduler:
instanceName: easyflowScheduler
instanceId: AUTO
jobStore:
misfireThreshold: 1000
isClustered: true
clusterCheckinInterval: 15000
# 如果数据库大小写敏感可将ddl里的相关表名改为大写
tablePrefix: TB_QRTZ_
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
threadPool:
threadCount: 8
threadPriority: 5
threads:
virtual:
enabled: true
easy-agents:
scheduler:
enabled: true
data-source-bean-name: dataSource
quartz:
scheduler-name: easyflowScheduler
instance-id: AUTO
table-prefix: TB_QRTZ_
driver-delegate-class: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
clustered: true
thread-count: 8
thread-priority: 5
# 短 Handler 可按可用线程批量获取同一计划时刻的 Trigger批量模式由底座强制在锁内获取。
batch-trigger-acquisition-max-count: 8
# 保持 0避免下一计划时刻的任务被同一批次提前执行。
batch-trigger-acquisition-fire-ahead-time-window-millis: 0
cluster-checkin-interval-millis: 15000
misfire-threshold-millis: 60000
wait-for-jobs-to-complete-on-shutdown: true
shutdown-wait-timeout-millis: 25000
validate-schema: true
# easy-agents 文档解析统一配置
document:
ocr:
provider: mineru
mineru:
# 统一文档解析桥接层直接复用 easy-agents 的 provider 配置,不在 easyflow 再复制一套配置体系
base-url: https://ontoweb.wust.edu.cn/mineru-api
submit-timeout-ms: 120000
default-lang-list:
- ch
easyflow:
mybatis:
# SQL 审计会同步输出脱敏后的参数化模板,仅在受控排查时临时开启。
sql-audit-enabled: ${EASYFLOW_MYBATIS_SQL_AUDIT_ENABLED:false}
job:
timezone: Asia/Shanghai
execution:
enabled: true
worker-count: 4
# 管理命令会同时占用业务事务与 Quartz JobStore 连接,需为连接池保留余量。
management-command-concurrency: 4
business-connection-reserve: 4
poll-interval: 500ms
lease-duration: 2m
heartbeat-interval: 30s
retry-backoff: 5s
shutdown-wait-timeout: 30s
infrastructure-retry-limit: 16
registration-max-attempts: 3
registration-retry-delay: 100ms
# 0 表示账本登记持续失败时保留同一次 Quartz fire直至数据库恢复。
registration-quartz-refire-limit: 0
registration-quartz-refire-delay: 250ms
datacenter:
# 数据源凭据使用独立部署密钥,禁止与仓库内其他固定密钥复用。
credential-key: cA0ldVrBRBWJlWN7BvaAGXmxH1+wCpoSE0y/iSudQsQ=
@@ -289,18 +321,6 @@ dromara:
bucket-name: easyflow-agent-artifacts
base-path: published
# easy-agents 文档解析统一配置
easy-agents:
document:
ocr:
provider: mineru
mineru:
# 统一文档解析桥接层直接复用 easy-agents 的 provider 配置,不在 easyflow 再复制一套配置体系
base-url: https://ontoweb.wust.edu.cn/mineru-api
submit-timeout-ms: 120000
default-lang-list:
- ch
# 自定义节点相关配置
node:
# 文件内容提取节点,默认使用简单文档读取器,可自行实现 ReadDocService