Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-5750

[subscription]add push-base subscription client sdk

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Others

    Description

      add push-base subscription client sdk

      only client sdk,Does not include server 

      // use case
      try (IPushConsumer pushConsumer =
          (new SubscriptionFactory())
              .createPushConsumer(
                  new SubscriptionConfiguration.Builder()
                      .host("localhost")
                      .port(6667)
                      .localHost("localhost")
                      .localPort(9997)
                      .username("root")
                      .password("root")
                      .topicStrategy(new SingleTopicStrategy("root.sg1"))
                      .disorderHandlingStrategy(new IntolerableStrategy())
                      .build())) {
        pushConsumer.registerDataArrivalListener(
            (data) -> {
              System.out.println("Start Data arrived----------------------------------");
              data.forEach(
                  (item) -> {
                    System.out.printf(
                        "Time: %s, paths: %s, values: ",
                        item.getTime(), String.join("、", item.getColumnNames()));
                    if (item.getColumnNames().size() > 0) {
                      for (int i = 0; i < item.getColumnNames().size(); i++) {
                        System.out.printf("%s, ", item.Data().getInt(i));
                      }
                    }
                    System.out.println();
                  });
              System.out.println("End Data arrived----------------------------------");
            });
        pushConsumer.openSubscription();
        pushConsumer.start(); 

       

      添加推送模式的消息订阅客户端sdk

      只有客户端,不含订阅服务的

      Attachments

        Activity

          People

            Unassigned Unassigned
            critas Xuan Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: