src/main/java/com/duxinglangzi/canal/starter/configuration/CanalAutoConfigurationProperties.java
@@ -9,6 +9,7 @@ /** * Canal连接的配置类 * * @author wuqiong 2022/4/11 */ @Order(Ordered.HIGHEST_PRECEDENCE) @@ -60,20 +61,19 @@ private int retryCount = 5; /** * * mysql 数据解析关注的表,Perl正则表达式. * <p> * * <p> * 多个正则之间以逗号(,)分隔,转义符需要双斜杠(\\) * <p> * * <p> * 常见例子: <p> * 1. 所有库表:.* or .*\\..* <p> * 2. canal_db 下所有表: canal_db\\..* <p> * 3. canal_db 下的以canal打头的表: canal_db\\.canal.* <p> * 4. canal_db 下的一张表: canal_db\\.test1 <p> * 5. 多个规则组合使用:canal_db\\..*,mysql_db.test1,mysql.test2 (逗号分隔) <p> * * <p> * 默认: 全库全表(.*\\..*) */ private String subscribe = ".*\\..*"; src/main/java/com/duxinglangzi/canal/starter/configuration/CanalBootstrapConfiguration.java
@@ -15,6 +15,7 @@ /** * 注册 CanalListenerAnnotationBeanPostProcessor 到spring bean 容器内 * * @param importingClassMetadata * @param registry * @return void src/main/java/com/duxinglangzi/canal/starter/configuration/CanalConfigurationSelector.java
@@ -10,6 +10,7 @@ /** * 扫描器 导入指定类, 这里导入 CanalBootstrapConfiguration.class * * @param importingClassMetadata * @return java.lang.String[] * @author wuqiong 2022-04-23 20:20 src/main/java/com/duxinglangzi/canal/starter/configuration/CanalListenerEndpointRegistrar.java
@@ -15,6 +15,7 @@ /** * 登记员 * * @author wuqiong 2022/4/11 */ public class CanalListenerEndpointRegistrar { @@ -26,6 +27,7 @@ * 1、目前实现的 DML 解析器仅支持两个参数 <p> * 2、且顺序必须为: CanalEntry.EventType 、 CanalEntry.RowData <p> * 3、如果CanalListener 指定的 destination 不在配置文件内,则直接抛错 <p> * * @param sets * @return void * @author wuqiong 2022-04-23 20:27 @@ -55,6 +57,7 @@ /** * 过滤参数 * * @param database * @param tableName * @param eventType src/main/java/com/duxinglangzi/canal/starter/container/AbstractCanalTransponderContainer.java
@@ -10,6 +10,7 @@ /** * 抽象的canal transponder ,实现SmartLifecycle接口,声明周期由spring进行管理 * * @author wuqiong 2022/4/11 */ public abstract class AbstractCanalTransponderContainer implements SmartLifecycle { @@ -21,7 +22,9 @@ CanalEntry.EntryType.HEARTBEAT); protected abstract void doStart(); protected abstract void initConnect(); protected abstract void disconnect(); @@ -55,7 +58,7 @@ return isRunning; } protected void setRunning(boolean bool){ protected void setRunning(boolean bool) { isRunning = bool; } src/main/java/com/duxinglangzi/canal/starter/container/DmlMessageTransponderContainer.java
@@ -13,6 +13,7 @@ /** * DML 数据拉取、解析 * * @author wuqiong 2022/4/11 */ public class DmlMessageTransponderContainer extends AbstractCanalTransponderContainer { @@ -40,7 +41,7 @@ } public void disconnect(){ public void disconnect() { // 关闭连接 connector.disconnect(); } src/main/java/com/duxinglangzi/canal/starter/factory/CanalConnectorFactory.java
@@ -17,6 +17,7 @@ /** * 创建 CanalConnector * * @param destination * @param endpointInstance * @return CanalConnector src/main/java/com/duxinglangzi/canal/starter/factory/TransponderContainerFactory.java
@@ -22,6 +22,7 @@ /** * 将所有待注册的端点,注册到spring中 * * @param beanFactory * @param canalConfig * @param registrars src/main/java/com/duxinglangzi/canal/starter/listener/ApplicationReadyListener.java
@@ -8,7 +8,7 @@ /** * @author wuqiong 2022/4/16 */ public class ApplicationReadyListener implements ApplicationListener<ApplicationReadyEvent>{ public class ApplicationReadyListener implements ApplicationListener<ApplicationReadyEvent> { public static final AtomicBoolean START_LISTENER_CONTAINER = new AtomicBoolean(false);