1. 修复消息格式不匹配问题 - 增量消息:兼容 SyncMessage 格式,从 dataSnapshot 字段反序列化数据 - 批量消息:添加 getDataType() 方法获取泛型类型,正确转换 JSONObject 2. 防止消息循环 - 添加 zt.databus.change.producer.enabled 配置项 - 客户端禁用变更消息发送,避免 客户端写入 → 发送变更 → 循环 3. 修复 Feign 客户端注入 - 在 RpcConfiguration 中添加 DeptApi、PostApi - 确保客户端能通过 Feign 调用本地 system-server API 相关文件: - DatabusClientConsumer.java: 修复消息解析逻辑 - BatchSyncEventHandler.java: 添加 getDataType() 方法 - DatabusChangeProducer.java: 添加 enabled 开关 - RpcConfiguration.java: 启用 DeptApi/PostApi Feign 客户端 Ref: 修复 ClassCastException 和消息循环问题
105 lines
3.7 KiB
YAML
105 lines
3.7 KiB
YAML
spring:
|
||
# 数据源配置项
|
||
autoconfigure:
|
||
# noinspection SpringBootApplicationYaml
|
||
exclude:
|
||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||
datasource:
|
||
druid: # Druid 【监控】相关的全局配置
|
||
web-stat-filter:
|
||
enabled: true
|
||
stat-view-servlet:
|
||
enabled: true
|
||
allow: # 设置白名单,不填则允许所有访问
|
||
url-pattern: /druid/*
|
||
login-username: # 控制台管理用户名和密码
|
||
login-password:
|
||
filter:
|
||
stat:
|
||
enabled: true
|
||
log-slow-sql: true # 慢 SQL 记录
|
||
slow-sql-millis: 100
|
||
merge-sql: true
|
||
wall:
|
||
config:
|
||
multi-statement-allow: true
|
||
dynamic: # 多数据源配置
|
||
druid: # Druid 【连接池】相关的全局配置
|
||
initial-size: 1 # 初始连接数
|
||
min-idle: 1 # 最小连接池数量
|
||
max-active: 20 # 最大连接池数量
|
||
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
|
||
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
|
||
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
|
||
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
|
||
validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
|
||
test-while-idle: true
|
||
test-on-borrow: false
|
||
test-on-return: false
|
||
primary: master
|
||
datasource:
|
||
master:
|
||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||
username: SYSDBA
|
||
password: pgbsci6ddJ6Sqj@e
|
||
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
|
||
lazy: true # 开启懒加载,保证启动速度
|
||
url: jdbc:dm://172.16.46.247:1050?schema=RUOYI-VUE-PRO
|
||
username: SYSDBA
|
||
password: pgbsci6ddJ6Sqj@e
|
||
|
||
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
|
||
data:
|
||
redis:
|
||
host: 172.16.46.63 # 地址
|
||
port: 30379 # 端口
|
||
database: 0 # 数据库索引
|
||
# password: 123456 # 密码,建议生产环境开启
|
||
|
||
xxl:
|
||
job:
|
||
admin:
|
||
addresses: http://172.16.46.63:30082/xxl-job-admin # 调度中心部署跟地址
|
||
|
||
# Lock4j 配置项
|
||
lock4j:
|
||
acquire-timeout: 3000 # 获取分布式锁超时时间,默认为 3000 毫秒
|
||
expire: 30000 # 分布式锁的超时时间,默认为 30 毫秒
|
||
|
||
# Actuator 监控端点的配置项
|
||
management:
|
||
endpoints:
|
||
web:
|
||
base-path: /actuator # Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||
exposure:
|
||
include: '*' # 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||
|
||
# 日志文件配置
|
||
logging:
|
||
level:
|
||
# 配置自己写的 MyBatis Mapper 打印日志
|
||
com.zt.plat.module.databus.dal.mysql: debug
|
||
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR
|
||
|
||
mybatis-plus:
|
||
configuration:
|
||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||
|
||
|
||
# RocketMQ 配置项
|
||
rocketmq:
|
||
name-server: 172.16.46.63:9876 # RocketMQ Namesrv
|
||
producer:
|
||
group: databus-server-producer-group # 生产者组名
|
||
send-message-timeout: 10000 # 发送消息超时时间,单位:毫秒
|
||
|
||
# ZT配置项,设置当前项目所有自定义的配置
|
||
zt:
|
||
env: # 多环境的配置项
|
||
tag: ${HOSTNAME}
|
||
security:
|
||
mock-enable: true
|
||
access-log: # 访问日志的配置项
|
||
enable: true
|
||
|