Example

    • 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.
    1. ClientConfiguration configuration = createClientConfig();
    2. // Init Inlong client
    3. InlongClient inlongClient = InlongClient.create(SERVICE_URL, configuration);
    4. try {
    5. // Create group conf
    6. InlongGroupConf groupConf = createGroupConf();
    7. // Init group resource by conf
    8. // Create stream conf
    9. InlongStreamConf streamConf = createStreamConf();
    10. InlongStreamBuilder streamBuilder = group.createStream(streamConf);
    11. // Create stream source
    12. streamBuilder.source(createSource());
    13. // Create stream sink
    14. // Init stream
    15. streamBuilder.initOrUpdate();
    16. // Start group in server
    17. InlongGroupContext inlongGroupContext = group.init();
    18. } catch (Exception e) {
    19. }