-
Notifications
You must be signed in to change notification settings - Fork 14
KCL Protocol
nieksand edited this page Oct 24, 2014
·
12 revisions
Some protocol documentation is here: https://github.com/awslabs/amazon-kinesis-client/blob/master/src/main/java/com/amazonaws/services/kinesis/multilang/package-info.java
- consume from stdin
- control responses to stdout
- error output to stderr
The protocol itself is request/response based. Except when checking pointing, the client always responds with a status
action.
A typical request/reply flow:
- REQ: action=processRecords
- RESP: action=status
A checkpointed request/reply flow:
- REQ: action=processRecords
- RESP: action=checkpoint
- REQ: action=checkpoint
- RESP: action=status
Initialize processor
{"action":"initialize","shardId":"shardId-123"}
Process batch of records
{"action":"processRecords","records":[{"data":"bWVvdw==","partitionKey":"cat","sequenceNumber":"456"}]}
Graceful terminate processor. Should checkpoint final work.
{"action":"shutdown","reason":"TERMINATE"}
Rough terminate processor. Do not checkpoint final work.
{"action":"shutdown","reason":"ZOMBIE"}
Checkpoint all consumed messages
{"action": "checkpoint", "checkpoint": null}
Checkpoint to sequence number
{"action": "checkpoint", "checkpoint": 1234}