amazon-kinesis-connectors
amazon-kinesis-connectors copied to clipboard
finish Application after consuming n records from the stream with graceful shutdown
I want to read/consume n records form the kinesis stream using Amazon-kinesis connector. After reading n records I want to finish/kill or exit the application with graceful shutdown. Can anyone provide me some suggestions regarding:
- How to call the shutdown() method of the worker ?
- how can I manage the count of records I have read at particular point of time so that i can call the shutdown() method
@awadeshmmm That is not how the KCL works. The KCL keeps the ShardConsumer around for as long as the shard is active. So the only way to shutdown a particular consumer would be to split or merge a shard. Splitting or mergeing a shard would lead to ShardConsumers being created for the children shards.
Thanks @sahilpalvia , One more question, How KCL ensures load balancing and scaling. for example i have a stream with one shard and a lot of records/events are put for 15 mintues in whole day or for certain time. So how it will take care of such sudden traffic and load.