Files
EasyFlow/easyflow-starter/easyflow-starter-all/src/main/resources/application.yml
陈子默 8c174e5c02 feat: 切换定时任务至分布式调度底座
- 以执行账本和有界 Worker 承载重负载任务与故障接管

- 接入统一调度 Starter 并增加 MySQL 迁移、指标和回归测试
2026-08-31 14:57:08 +08:00

416 lines
12 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server:
port: 8111
address: 0.0.0.0
shutdown: graceful
# 启用HTTP响应压缩
compression:
enabled: true
servlet:
encoding:
enabled: true
charset: UTF-8 # 必须设置 UTF-8避免 WebFlux 流式返回AI 场景)会乱码问题
force: true
tomcat:
# Public API 单次最多 200 个文件,额外为 metadata 与表单边界预留 Part。
max-part-count: 205
spring:
profiles:
active: dev
lifecycle:
timeout-per-shutdown-phase: 30s
datasource:
#注意useInformationSchema=true 是必须的,用于支持 MyBatis-Flex 正确读取表注释。
url: jdbc:mysql://127.0.0.1:33306/easyflow?useInformationSchema=true&characterEncoding=utf-8
username: root
password: root
hikari:
# 调度管理 Saga 会同时占用业务事务和 Quartz JobStore 连接;容量由启动校验守护。
maximum-pool-size: 24
minimum-idle: 2
connection-timeout: 5000
validation-timeout: 3000
idle-timeout: 600000
max-lifetime: 1800000
flyway:
enabled: true
locations: classpath:db/migration/mysql
baseline-on-migrate: false
validate-on-migrate: true
clean-disabled: true
data:
redis:
host: 127.0.0.1
port: 36379
database: 0
password: ${REDIS_PASSWORD:123456}
timeout: 5s
servlet:
multipart:
max-file-size: 100MB
# Public API 业务上限为 200 MiB为 metadata 与 multipart 边界预留空间。
max-request-size: 220MB
web:
resources:
# 示例windows【file: C:\easyflow\attachment】 linux【file: /www/easyflow/attachment】
static-locations: file:/Users/slience/postgraduate/easyflow/attachment
mvc:
pathmatch:
matching-strategy: ant_path_matcher
# 静态资源路径,用于访问本地文件
# 注意,这里要和下面的 easyflow.storage.local.prefix 后面的路径 /attachment 保持一致!
static-path-pattern: /attachment/**
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=
log-record:
# 普通只读请求不写操作日志;需要审计的读取接口使用 @LogRecord 显式标注
record-read-actions: false
retention:
enabled: true
days: 90
batch-size: 5000
max-batches: 20
cron: "0 30 2 * * *"
security:
account:
default-reset-password: "!QAZ2wsx"
multi-login: false
license:
location: classpath:easyflow.lic
chat:
# SSE 超时时间(毫秒),默认 10 分钟,可按需调整
sse-timeout-ms: 600000
cache:
session-list-ttl: 300s
session-summary-ttl: 600s
session-tail-ttl: 1800s
tail-size: 50
sync:
#是否启用分析数据同步,启用分析数据库后,此处应同步开启
enabled: true
batch-size: 500
fixed-delay: 30000
repair-lookback-days: 3
retention-months: 3
mq:
enabled: true
type: redis
redis:
database: 1
stream-prefix: easyflow:mq
consumer-instance-id: ${EASYFLOW_INSTANCE_ID:${HOSTNAME:${random.uuid}}}
chat-persist-shard-count: 4
consumer-batch-size: 200
consumer-block-timeout: 2000ms
pending-claim-idle: 60000ms
consumer-failure-initial-backoff: 1s
consumer-failure-max-backoff: 30s
consumer-failure-log-interval: 60s
max-retry: 16
consumer-executor:
core-size: 16
max-size: 32
queue-capacity: 64
keep-alive-seconds: 60
pool:
max-active: 12
max-idle: 8
min-idle: 1
analytical-db:
# 是否启用分析数据库
enabled: true
url: jdbc:clickhouse://110.42.53.158:38123/easyflow_dev?jdbc_ignore_unsupported_values=true&socket_timeout=30000&compress=false&ssl=false
username: easyflow
password: 123456
driver-class-name: com.clickhouse.jdbc.ClickHouseDriver
pool:
max-pool-size: 10
min-idle: 1
connection-timeout: 5000
validation-timeout: 3000
idle-timeout: 600000
max-lifetime: 1800000
flyway:
analytical-db:
locations: classpath:db/migration/analyticaldb
table: flyway_schema_history_analytical_db
baseline-on-migrate: false
validate-on-migrate: true
# 语音播放、识别服务(阿里云)
audio:
type: aliAudioService
ali:
access-key-id: xxx
access-key-secret: xxx
app-key: xxx
voice: siyue
agent:
workspace:
root: ./agent-workspaces
max-total-size: 512MB
max-single-file-size: 100MB
max-file-count: 2000
max-read-size: 2MB
retention: 24h
cleanup-interval: 30m
shell:
default-timeout: 60s
max-timeout: 300s
max-command-length: 4096
max-output-size: 1MB
max-concurrent-per-instance: 2
runtime:
instance-id: ${EASYFLOW_INSTANCE_ID:${HOSTNAME:${random.uuid}}}
route-ttl: 24h
command-topic-prefix: easyflow:agent-runtime-command
command-result-timeout: 5s
command-result-ttl: 5m
media:
platform: minio-agent-media
max-image-count: 5
max-image-bytes: 10485760
max-image-pixels: 40000000
upload-ttl: 24h
composer-draft-ttl: 24h
cleanup-interval: 10m
login:
# 放行接口路径
excludes: /api/v1/auth/**, /static/**, /userCenter/auth/**, /userCenter/public/**
dev-bypass:
enabled: true
account: admin
loopback-only: true
storage:
# local / xFileStorage
type: xFileStorage
# 本地文件存储配置(兼容保留,可作为回退)
local:
# 示例windows【C:\easyflow\attachment】 linux【/www/easyflow/attachment】
root: /Users/slience/postgraduate/easyflow/attachment
# 后端接口地址,用于拼接完整 url
prefix: http://localhost:8111/attachment
ai:
rag:
health:
cache-ttl: 5s
document-import:
bulk:
max-file-count: 2000
max-total-size: 1GB
max-file-size: 100MB
upload-concurrency: 3
parse-max-running: 2
split-max-running: 2
index-max-running: 2
per-batch-parse-max-running: 2
pending-dispatch-batch-size: 100
pending-dispatch-interval: 2s
pending-redispatch-delay: 5s
pending-timeout: 24h
parse-submit-timeout: 120s
interruption-timeout: 10m
max-task-attempts: 3
status-broadcast-channel: easyflow:document-import:status
parse-monitor:
fixed-delay: 10000
initial-delay: 10000
batch-size: 10
thread-pool:
sse:
core-size: 4
max-size: 16
queue-capacity: 2000
keep-alive-seconds: 30
allow-core-thread-timeout: true
document-import:
core-size: 2
max-size: 4
queue-capacity: 200
keep-alive-seconds: 60
allow-core-thread-timeout: true
scheduler:
pool-size: 4
# xFileStorage存储文件配置
# 文档https://x-file-storage.xuyanwu.cn/
dromara:
x-file-storage:
default-platform: minio-1
minio:
- platform: minio-1
enable-storage: true
access-key: easyflowadmin
secret-key: easyflowadmin123
end-point: http://127.0.0.1:39000
bucket-name: easyflow
# minio 对象对外访问链接
domain: http://127.0.0.1:39000/easyflow/
base-path: attachment
- platform: minio-agent-media
enable-storage: true
access-key: easyflowadmin
secret-key: easyflowadmin123
end-point: http://127.0.0.1:39000
bucket-name: easyflow-agent-media
base-path: agent-chat
- platform: minio-agent-artifacts
enable-storage: true
access-key: easyflowadmin
secret-key: easyflowadmin123
end-point: http://127.0.0.1:39000
bucket-name: easyflow-agent-artifacts
base-path: published
# 自定义节点相关配置
node:
# 文件内容提取节点,默认使用简单文档读取器,可自行实现 ReadDocService
reader: 'defaultReader'
# gitee 文档读取的实现需要配置gitee的appKey
gitee:
appKey: 'xxx'
# 搜索引擎节点 - 目前只支持博查搜索
bochaai:
apiKey: 'xxx'
code-engine:
python:
enabled: true
command: python3
timeout-ms: 5000
max-output-bytes: 262144
working-dir: /tmp
jetcache:
# 缓存类型可选值local/remote/both CacheConfig 类初始化
cacheType: remote
statIntervalMinutes: 15
areaInCacheName: false
local:
default:
type: linkedhashmap
keyConvertor: fastjson
remote:
default:
type: redis
keyConvertor: fastjson2
broadcastChannel: easyflow-cache
valueEncoder: java
valueDecoder: bean:easyFlowJetCacheValueDecoder
poolConfig:
minIdle: 1
maxIdle: 12
maxTotal: 32
host: ${spring.data.redis.host}
port: ${spring.data.redis.port}
password: ${spring.data.redis.password}
database: ${spring.data.redis.database}
# 多路召回搜索引擎配置
rag:
# 搜索引擎选择lucene/ES
engine: lucene
# 向量数据库配置
milvus:
uri: http://127.0.0.1:39530
databaseName: default
token:
username: easyflowadmin
password: easyflowadmin123
autoCreateCollection: true
# 搜索引擎配置
searcher:
lucene:
indexDirPath: /Users/slience/data/easyflow/luceneKnowledge
elastic:
host: http://127.0.0.1:39200
userName: elastic
password: elastic
indexName: easyflow
logging:
file:
path: .logs/
name: easyflow.log
level:
root: info
tech.easyflow.ai: debug
io.agentscope.core.model.OpenAIClient: debug
# 行为验证码配置
captcha:
# 初始化默认资源
init-default-resource: true
# 开启二次验证
secondary:
enabled: true
management:
endpoint:
health:
probes:
enabled: true
show-details: always
endpoints:
web:
exposure:
include: health,info