amazon-kinesis-client icon indicating copy to clipboard operation
amazon-kinesis-client copied to clipboard

Retrieving shard consumer's current lease's hash range key

Open apoorvt95 opened this issue 1 year ago • 2 comments

Is it possible to retrieve current lease's hash range key in the initialize lifecycle method of KCL consumer?

The only way I could find is through injecting LeaseCoordinator dependency in the ShardRecordProcessor implementation. This ends up creating a circular dependency during dependency injection.

LeaseCoordinator <- Schedulor ConfigBuilder <- ShardRecordFactory <- ShardRecordProcessor <- LeaseCoordinator.

apoorvt95 avatar Jan 19 '24 23:01 apoorvt95

Could you explain the use case that you are looking for in getting the hash key range for a lease in the initialize function?

brendan-p-lynch avatar Mar 08 '24 23:03 brendan-p-lynch

I have a use case where I'm pushing data to Kinesis streams and partitioning my data deterministically.

I'm reading the data using KCL library. In my use case, I have metadata stored in a Datastore partitioned over range of hash keys for Kinesis Shards. I want to selectively load the metadata for a specific shard using the shard's hash range key during initialize function of a Shard consumer.

apoorvt95 avatar Mar 17 '24 04:03 apoorvt95