mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
kafka 客户端 example 完善
This commit is contained in:
@@ -86,7 +86,6 @@ public class KafkaCanalClientExample {
|
||||
}
|
||||
|
||||
private void process() {
|
||||
while (running) {
|
||||
try {
|
||||
connector.subscribe();
|
||||
while (running) {
|
||||
@@ -110,7 +109,11 @@ public class KafkaCanalClientExample {
|
||||
|
||||
connector.ack(); // 提交确认
|
||||
} catch (WakeupException e) {
|
||||
try {
|
||||
Thread.sleep(500); //延时确保running状态的改变
|
||||
} catch (InterruptedException ie) {
|
||||
//ignore
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
}
|
||||
@@ -122,4 +125,3 @@ public class KafkaCanalClientExample {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user