@Test
  public void do_test()
      throws InterruptedException,
          TException,
          IoTDBConnectionException,
          IOException,
          StatementExecutionException {
    // Write data before subscribing
    insert_data(1706659200000L); // 2024-01-31 08:00:00+08:00
    session_src.executeNonQueryStatement(
        "insert into "
            + device
            + "(time,`ABH#01`,`BJ-ABH#01`)values(1710288000000,313,false);"); // 2024-03-13
    // 08:00:00+08:00
    // Subscribe
    consumer = create_pull_consumer("`Group-ABH#01`", "`ABH#01`", false, 0L);
    assertEquals(subs.getSubscriptions().size(), 0, "Before subscribing, show subscriptions");
    consumer.subscribe(topicName);
    assertEquals(subs.getSubscriptions().size(), 1, "show subscriptions after subscription");
    // Consumption data
    consume_data(consumer);
    check_count(4, "select count(`ABH#01`) from " + device, "Consumption data:" + pattern);
    // Unsubscribe
    consumer.unsubscribe(topicName);
    assertEquals(subs.getSubscriptions().size(), 0, "After cancellation, show subscriptions");
    // Subscribe and then write data
    insert_data(1707782400000L); // 2024-02-13 08:00:00+08:00
    session_src.executeNonQueryStatement(
        "insert into "
            + device
            + "(time,`ABH#01`,`BJ-ABH#01`)values(1703980800000,1231,false);"); // 2023-12-31
    // 08:00:00+08:00
    consumer.subscribe(topicName);
    assertEquals(subs.getSubscriptions().size(), 1, "show subscriptions after re-subscribing");
    // Consumption data
    consume_data(consumer);
    check_count(8, "select count(`ABH#01`) from " + device, "consume data again:" + pattern);
    // Unsubscribe
    consumer.unsubscribe(topicName);
  }
Sequence-level topic, with start, end, tsfile
integration-test/src/test/java/org/apache/iotdb/subscription/it/triple/treemodel/regression/topic/IoTDBDataSet1TopicConsumerSpecialIT.java