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

finish Application after consuming n records from the stream with graceful shutdown

Open awadeshtech opened this issue 7 years ago • 2 comments

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:

  1. How to call the shutdown() method of the worker ?
  2. how can I manage the count of records I have read at particular point of time so that i can call the shutdown() method

awadeshtech avatar Feb 01 '18 11:02 awadeshtech

@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.

sahilpalvia avatar Feb 01 '18 18:02 sahilpalvia

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.

awadeshtech avatar Feb 05 '18 08:02 awadeshtech