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.
ClientConfiguration configuration = createClientConfig();
// Init Inlong client
InlongClient inlongClient = InlongClient.create(SERVICE_URL, configuration);
try {
// Create group conf
InlongGroupConf groupConf = createGroupConf();
// Init group resource by conf
// Create stream conf
InlongStreamConf streamConf = createStreamConf();
InlongStreamBuilder streamBuilder = group.createStream(streamConf);
// Create stream source
streamBuilder.source(createSource());
// Create stream sink
// Init stream
streamBuilder.initOrUpdate();
// Start group in server
InlongGroupContext inlongGroupContext = group.init();
} catch (Exception e) {
}