public void ack(long batchId) throws CanalClientException { int times = 0; while (times < retryTimes) { try { currentConnector.ack(batchId); return; } catch (Throwable t) { logger.warn( "something goes wrong when acking data from server:{}\n{}", currentConnector.getAddress(), t); times++; restart(); logger.info("restart the connector for next round retry."); } } throw new CanalClientException("failed to fetch the data after " + times + " times retry"); }
public Message get(int batchSize) throws CanalClientException { waitClientRunning(); Message msg = getWithoutAck(batchSize); ack(batchSize); return msg; }