This commit is contained in:
agapple
2020-08-22 13:07:24 +08:00
parent 90bf9e6de5
commit b79af46054
66 changed files with 459 additions and 477 deletions

View File

@@ -76,16 +76,17 @@ public class AbstractCanalClientTest extends BaseCanalClientTest {
if (batchId != -1) {
connector.ack(batchId); // 提交确认
// connector.rollback(batchId); // 处理失败, 回滚数据
}
}
} catch (Exception e) {
} catch (Throwable e) {
logger.error("process error!", e);
try {
Thread.sleep(1000L);
} catch (InterruptedException e1) {
// ignore
}
connector.rollback(); // 处理失败, 回滚数据
} finally {
connector.disconnect();
MDC.remove("destination");

View File

@@ -117,8 +117,7 @@ public class CanalKafkaClientFlatMessageExample {
}
for (FlatMessage message : messages) {
long batchId = message.getId();
int size = message.getData() == null ? 0 : message.getData().size();
if (batchId == -1 || size == 0) {
if (batchId == -1 || message.getData() == null) {
// try {
// Thread.sleep(1000);
// } catch (InterruptedException e) {