Explorar o código

Merge pull request #931 from rewerma/master

fix #904: 空记录时sleep 1s防止循环get数据过快
agapple %!s(int64=6) %!d(string=hai) anos
pai
achega
1ab1f119b8

+ 6 - 0
server/src/main/java/com/alibaba/otter/canal/kafka/CanalKafkaStarter.java

@@ -147,6 +147,12 @@ public class CanalKafkaStarter implements CanalServerStarter {
                                     server.rollback(clientIdentity, batchId);
                                 }
                             }); // 发送message到topic
+                        } else {
+                            try {
+                                Thread.sleep(100);
+                            } catch (InterruptedException e) {
+                                // ignore
+                            }
                         }
 
                     } catch (Exception e) {