Get Started With Hazelcast Jet Job Management
In this tutorial, you’ll learn the basics of how to manage stream processing pipelines using the Hazelcast CLC with Hazelcast Cloud. You’ll see how to connect to a cluster on Cloud, and submit a sample Jet job that generates a stream of numbers. You’ll also learn how to use simple commands to monitor and cancel jobs.
Before You Begin
You need the following:
-
Hazelcast CLC installed on your local machine
-
One running Cloud cluster. You can create a development cluster using the Hazelcast CLC.
-
JRE 11 or above.
-
Gradle 8 or above.
Step 3. Connect to Your Cluster
For Hazelcast CLC to connect to your development cluster, you need to import the cluster’s configuration, including its connection details.
Run the following command to save the cluster configuration with the name dev
. Replace the $CLUSTER_NAME
placeholder with the name of your cluster, shown in the top-left corner of the dashboard.
Step 4. Build the Jet Job
Now you’re ready to build the sample Jet job.
-
Clone the GitHub repository.
-
Switch to the project directory.
cd hazelcast-commandline-client/examples/platform/simple-streaming-pipeline
Step 5. Submit and Monitor the Jet Job
Submitting the sample Jet job generates a stream of numbers and creates a hashid for each number. The number and hashid pair are then saved to a Map called my-map
, with the number as the key and hashid as the value.
-
Execute the following command to submit the Jet job:
The Hazelcast CLC waits until the job starts to run.
-
Now, list the jobs in the cluster. You should see
simple-pipeline
in aRUNNING
state. -
Create a new advanced script in your favorite text editor. For example:
-
Add the following:
-
Run your script.
-
See how the size of
my-map
increases as entries are written to it. -
Press Ctrl+C when you’re ready to stop the script.
Summary
In this tutorial, you learned how to do the following:
-
Connect to a cluster on Cloud.
-
Build and submit a Hazelcast Jet job to create a data pipeline.
-
Manage the lifecycle of a Jet job using list and cancel commands.