- Newest
- Most votes
- Most comments
Hello,
Your understanding is correct RegisterStreamConsumer API registers a consumer with a Kinesis data stream. When you use this operation, the consumer you register can then call SubscribeToShard to receive data from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every shard you subscribe to[1]
aws kinesis register-stream-consumer --consumer-name con1 --stream-arn arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1
{
"Consumer": {
"ConsumerName": "con1",
"ConsumerARN": "arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1/consumer/con1:1679992900",
"ConsumerStatus": "CREATING",
"ConsumerCreationTimestamp": "2023-03-28T14:11:40+05:30"
}
}
We get ConsumerStatus as CREATING because RegisterStreamConsumer is asynchronous operation which responds with acknowledgment first and registers consumer asynchronously due to which we don't receive the updated status of the consumer.
You can consider using ListStreamConsumers or DescribeStreamConsumer API to check the current status of your consumer as per your use case[2][3]
Sharing example outputs for reference:
aws kinesis list-stream-consumers --stream-arn arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1
{
"Consumers": [
{
"ConsumerName": "con1",
"ConsumerARN": "arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1/consumer/con1:1679992900",
"ConsumerStatus": "ACTIVE",
"ConsumerCreationTimestamp": "2023-03-28T14:11:40+05:30"
}
]
}
aws kinesis describe-stream-consumer --stream-arn arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1 --consumer-name con1
{
"ConsumerDescription": {
"ConsumerName": "con1",
"ConsumerARN": "arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1/consumer/con1:1679992900",
"ConsumerStatus": "ACTIVE",
"ConsumerCreationTimestamp": "2023-03-28T14:11:40+05:30",
"StreamARN": "arn:aws:kinesis:us-east-1:xxxxxxxxx:stream/test1"
}
}
[1] RegisterStreamConsumer - https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html
[2] ListStreamConsumers - https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreamConsumers.html
[3] DescribeStreamConsumer - https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DescribeStreamConsumer.html
Relevant content
- AWS OFFICIALUpdated 5 years ago
