mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
Canal monitoring(prometheus module) snapshot version.
This commit is contained in:
@@ -3,6 +3,7 @@ package com.alibaba.otter.canal.example;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
@@ -115,7 +116,7 @@ public class AbstractCanalClientTest {
|
||||
connector.connect();
|
||||
connector.subscribe();
|
||||
while (running) {
|
||||
Message message = connector.getWithoutAck(batchSize); // 获取指定数量的数据
|
||||
Message message = connector.getWithoutAck(batchSize, 1000L, TimeUnit.MILLISECONDS); // 获取指定数量的数据
|
||||
long batchId = message.getId();
|
||||
int size = message.getEntries().size();
|
||||
if (batchId == -1 || size == 0) {
|
||||
|
||||
Reference in New Issue
Block a user