Example

Overview

Apache InLong Manager is the user-oriented unified UI of the entire data access platform. Now we provide client SDK for users, which means you can use client to manipulate your group task instead of UI.

Dependency

  • Add Maven Dependency

    1. <dependency>
    2. <groupId>org.apache.inlong</groupId>
    3. <artifactId>manager-client</artifactId>
    4. <version>2.1.0-SNAPSHOT</version>
    5. </dependency>

Code

  • We provide two unit cases for you to build your own group task, you can replace the predefined params and try it in your own cluster.
  • In following cases, Apache Pulsar and Apache Flink are needed when your group is inited. You can run Inlong group in your own cluster, or with the help of third-party services.

Programming must know interface

  1. // Create client configuration
  2. ClientConfiguration configuration = createClientConfig();
  3. // Init Inlong client
  4. InlongClient inlongClient = InlongClient.create(SERVICE_URL, configuration);
  5. try {
  6. // Create group conf
  7. InlongGroupConf groupConf = createGroupConf();
  8. // Init group resource by conf
  9. InlongGroup group = inlongClient.forGroup(groupConf);
  10. // Create stream conf
  11. InlongStreamConf streamConf = createStreamConf();
  12. // Create Stream builder
  13. InlongStreamBuilder streamBuilder = group.createStream(streamConf);
  14. // Create stream source
  15. streamBuilder.source(createSource());
  16. // Create stream sink
  17. streamBuilder.sink(createSink());
  18. // Init stream
  19. streamBuilder.initOrUpdate();
  20. // Start group in server
  21. InlongGroupContext inlongGroupContext = group.init();
  22. } catch (Exception e) {
  23. e.printStackTrace();
  24. }

Kafka2Hive

Refer to manager-client-examples org.apache.inlong.manager.client.Kafka2HiveExample.java

Binlog2Kafka

Refer to manager-client-examples org.apache.inlong.manager.client.Binlog2KafkaExample.java

Last but not Least

If you have any question about manager client, communicate with us please.