Adding a Checkpoint

Initialize a DIS SDK client instance as instructed in Initializing a DIS SDK Client Instance.

The commitCheckpoint_sample.py file provides a code sample. Configure the following parameters in this file:

1
2
3
4
5
streamname=" "   #Name of the stream.
appName="xx"  #Name of an existing application.
partitionId="shardId-0000000000"   #Unique identifier of the partition.
seqNumber="0"   #Sequence number.
metadata=""  #Metadata information of the consumer application. The maximum length of the metadata information is 1,000 characters.

Before obtaining the partition ID, import the stream name and then refer to the instructions in Querying Stream Details.

After configuring the parameters, run the commitCheckpoint_sample.py file to call commitCheckpoint_test. If response code 201 is returned, the checkpoint is successfully added.