Skip to content

Kinesis Hands On

Hands onΒΆ

Visit Kinesis from [[AWS Console]].

Create a data stream.

Then you can work with it using the CLI.

$ aws kinesis help
$ aws kinesis list-streams help
$ aws kinesis list-streams
{
    "StreamNames": [
        "my-first-stream"
    ]
}
$ aws kinesis describe-stream help
$ aws kinesis describe-stream --stream-name my-first-stream
{...}
$ aws kinesis put-record --stream-name my-first-stream --data "user signup" --partition-key user_123
{
    "ShardId": "shardId-00000000000",
    "SequenceNumber": "4958877456415503463748463555080986096182857601881824546"
}
$ aws kinesis get-shard-iterator --stream-name my-first-stream --shard-id shardId-00000000000 --shard-iterator-type TRIM_HORIZON
{
    "ShardIterator": "..."
}
$ aws kinesis get-records help
$ aws kinesis get-records --shard-iterator "..." 
{
    "Records": [
        {
            "SequenceNumber": "4955877456415503463...",
            "AppriximateArrivalTImestamp": 1538394164.478,
            "Data": "dXNlciBzaWdudXa=", // base64 encoded
            "PartitionKey": "user_123"
        },
        ...
    ],
    "NextShardIterator": "AAA...",
    "MillisBehindLatest": 0
}