Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
apoorvt95 opened this issue Jan 19, 2024 · 2 comments
Open

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

apoorvt95 opened this issue Jan 19, 2024 · 2 comments

Comments

@apoorvt95
Copy link

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.

@brendan-p-lynch
Copy link
Contributor

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

@apoorvt95
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants