瀏覽代碼

简化配置参数

AE86 1 年之前
父節點
當前提交
38e0935c45

+ 0 - 5
dbsyncer-common/src/main/java/org/dbsyncer/common/config/BinlogRecorderConfig.java

@@ -1,15 +1,10 @@
 package org.dbsyncer.common.config;
 
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
 /**
  * @author AE86
  * @version 1.0.0
  * @date 2022/7/14 23:50
  */
-@Configuration
-@ConfigurationProperties(prefix = "dbsyncer.storage.binlog.recorder")
 public class BinlogRecorderConfig {
 
     /**

+ 1 - 2
dbsyncer-storage/src/main/java/org/dbsyncer/storage/binlog/AbstractBinlogService.java

@@ -57,8 +57,7 @@ public abstract class AbstractBinlogService<Message> implements BinlogRecorder {
     @Autowired
     private SnowflakeIdWorker snowflakeIdWorker;
 
-    @Autowired
-    private BinlogRecorderConfig binlogRecorderConfig;
+    private BinlogRecorderConfig binlogRecorderConfig = new BinlogRecorderConfig();
 
     private Queue<BinlogMessage> queue;
 

+ 0 - 11
dbsyncer-web/src/main/resources/application.properties

@@ -24,17 +24,6 @@ dbsyncer.storage.support.mysql.enabled=false
 dbsyncer.storage.support.mysql.config.url=jdbc:mysql://127.0.0.1:3306/dbsyncer?rewriteBatchedStatements=true&seUnicode=true&characterEncoding=UTF8&serverTimezone=Asia/Shanghai&useSSL=false&verifyServerCertificate=false&autoReconnect=true
 dbsyncer.storage.support.mysql.config.username=root
 dbsyncer.storage.support.mysql.config.password=123
-# binlog指持久化增量数据到磁盘的任务
-# 从磁盘批量读取的任务数
-dbsyncer.storage.binlog.recorder.batch-count=10000
-# 最长处理时间(秒),在限定的时间内提交的任务没有被成功消费,将会重复执行
-dbsyncer.storage.binlog.recorder.max-processing-seconds=120
-# 任务队列容量
-dbsyncer.storage.binlog.recorder.queue-capacity=10000
-# 写磁盘间隔(毫秒)
-dbsyncer.storage.binlog.recorder.writer-period-millisecond=500
-# 读磁盘间隔(毫秒)
-dbsyncer.storage.binlog.recorder.reader-period-millisecond=2000
 
 #parser
 # 单次执行批量同步任务数