コード例 #1
0
  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");
  }
コード例 #2
0
ファイル: SimpleCanalConnector.java プロジェクト: baeeq/canal
 public Message get(int batchSize) throws CanalClientException {
   waitClientRunning();
   Message msg = getWithoutAck(batchSize);
   ack(batchSize);
   return msg;
 }