mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
修改example的一些bug
This commit is contained in:
@@ -38,7 +38,6 @@ public class AbstractCanalClientTest {
|
|||||||
protected static final String SEP = SystemUtils.LINE_SEPARATOR;
|
protected static final String SEP = SystemUtils.LINE_SEPARATOR;
|
||||||
protected static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
protected static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||||
protected volatile boolean running = false;
|
protected volatile boolean running = false;
|
||||||
private volatile boolean waiting = true;
|
|
||||||
protected Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
|
protected Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
|
||||||
|
|
||||||
public void uncaughtException(Thread t, Throwable e) {
|
public void uncaughtException(Thread t, Throwable e) {
|
||||||
@@ -97,6 +96,7 @@ public class AbstractCanalClientTest {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
connector.stopRunning();
|
connector.stopRunning();
|
||||||
|
running = false;
|
||||||
if (thread != null) {
|
if (thread != null) {
|
||||||
try {
|
try {
|
||||||
thread.join();
|
thread.join();
|
||||||
@@ -115,7 +115,6 @@ public class AbstractCanalClientTest {
|
|||||||
MDC.put("destination", destination);
|
MDC.put("destination", destination);
|
||||||
connector.connect();
|
connector.connect();
|
||||||
connector.subscribe();
|
connector.subscribe();
|
||||||
waiting = false;
|
|
||||||
while (running) {
|
while (running) {
|
||||||
Message message = connector.getWithoutAck(batchSize); // 获取指定数量的数据
|
Message message = connector.getWithoutAck(batchSize); // 获取指定数量的数据
|
||||||
long batchId = message.getId();
|
long batchId = message.getId();
|
||||||
|
|||||||
Reference in New Issue
Block a user