duxinglangzi
2022-04-23 6274208525b7e80c208f614915ef973d63834101
src/main/java/com/duxinglangzi/canal/starter/container/AbstractCanalTransponderContainer.java
@@ -9,8 +9,8 @@
import java.util.concurrent.TimeUnit;
/**
 * 抽象的canal transponder ,实现SmartLifecycle接口,声明周期由spring进行管理
 * @author wuqiong 2022/4/11
 * @description
 */
public abstract class AbstractCanalTransponderContainer implements SmartLifecycle {
    protected boolean isRunning = false;
@@ -26,13 +26,14 @@
    @Override
    public void start() {
        setRunning(true);
        new Thread(() -> {
            // spring 启动后 才会进行canal数据拉取
            while (!ApplicationReadyListener.START_LISTENER_CONTAINER.get())
                sleep(5L * SLEEP_TIME_MILLI_SECONDS);
            initConnect();
            while (isRunning() && !Thread.currentThread().isInterrupted()) doStart();
        }).start();
        setRunning(true);
    }
    @Override