public static void main()

in streampipes-pipeline-elements-examples-processors-jvm/src/main/java/org/apache/streampipes/client/example/Example.java [29:51]


  public static void main(String[] args) {
//    CredentialsProvider credentials = StreamPipesCredentials
//            .withApiKey(System.getenv("user"), System.getenv("apiKey"));

    CredentialsProvider credentials = StreamPipesCredentials.withServiceToken("sp-service-client", "my-apache-streampipes-secret-key-change-me");

    // Create an instance of the StreamPipes client
    StreamPipesClient client = StreamPipesClient
            .create("localhost", 8082, credentials, true);

    // Get all pipelines
    List<Pipeline> pipelines = client.pipelines().all();
    System.out.println(pipelines.size());

//    // Start a pipeline
//    PipelineOperationStatus message = client.pipelines().start(pipelines.get(0));
//
//    // Get all data streams
//    List<SpDataStream> dataStreams = client.streams().all();
//
//    // Subscribe to a data stream
//    client.streams().subscribe(dataStreams.get(0), event -> MapUtils.debugPrint(System.out, "event", event.getRaw()));
  }