What exactly does sequenceNumberForOrdering do when putting records into a Kinesis stream with the Java SDK?

Viewed 1404

I'm a bit confused about the AWS docs for putting records to Kinesis stream here: https://docs.aws.amazon.com/kinesis/latest/APIReference/API_PutRecord.html#API_PutRecord_RequestSyntax

It says that setting sequenceNumberForOrdering should be used for guaranteeing order "for puts from the same client and to the same partition key".

The example at the very bottom of this page is what confuses me:

  1. What should be the initial value of the variable sequenceNumberOfPreviousRecordin that example? "0"?
  2. Why does it not seem to matter for which partition key the previous record was put? (The loop in the example puts records for two different partition keys, 0 and 1.)

Maybe I just don't get it, but I think the docs could do a better job of explaining this.

1 Answers
Related