kinesis-consumer | Golang library for consuming Kinesis stream data | Pub Sub library
kandi X-RAY | kinesis-consumer Summary
kandi X-RAY | kinesis-consumer Summary
The consumer leverages a handler func that accepts a Kinesis record. The Scan method will consume all shards concurrently and call the callback func as it receives records from the stream.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of kinesis-consumer
kinesis-consumer Key Features
kinesis-consumer Examples and Code Snippets
Community Discussions
Trending Discussions on kinesis-consumer
QUESTION
I'm trying to start a new sample project using for process Kinesis Stream but I'm getting the following error:
...ANSWER
Answered 2020-Dec-17 at 19:54You probably try to use the latest Spring Boot 2.4.x
which brings for us Spring Integration 5.4
already. And this one is not compatible with the latest Spring Integration AWS, which is still based on the Spring Integration 5.3.x
.
Let's see if you still can stick with Spring Boot 2.3.x
!
QUESTION
I have a setup with a kinesis stream with 20 shards that is consumed by a kinesis consumer based on KCL. The consumer is deployed in ECS with 20 instances.(Meaning multiple KCL instances?)
What I believed would happen in this scenario is:
- Each instance would create 20 worker threads for each shard, independently of each other.
- So at any given time, a shard would have 20 separate threads connecting to it
- The same set of records would get processed by each instance (ie: duplicate record processing will not be handled across the instances)
- This would also exceed the consumer rate limits per each shard. ( 5 transactions per second)
- Running a single instance of my consumer is sufficient. In other words, scaling the consumer across multiple instances will not have any benefits at all.
This answer seem to suggest that the "shard's lease" would ensure that it is only processed by a single instance. However, the second answer here says that "A KCL instance will only start one process per shard, but you can have another KCL instance consuming the same stream (and shard), assuming the second one has permission.".
Further this documentation suggests "Increasing the number of instances up to the maximum number of open shards" as a possible scale-up approach which contradicts some of the above points.
How does the consumer instances actually function in this scenario?
...ANSWER
Answered 2020-Sep-06 at 08:44What would happen in the scenario you describe is that each of the 20 workers will eventually only process 1 shard.
At startup, each worker will try to claim as many shards by creating leases for those shards. When all 20 workers start simultaneously, they will all try to create leases for 20 shards, but this will not succeed for all of them. One worker may end up with eg 5 shards, and other ones with 2 or 3. After a few iterations of lease taking, though, each worker should have only 1 shard. This way the AWS rate limits are respected.
While this balancing process happens, it is possible for a short while for two workers to process the same records twice. This happens between the time that a worker steals a lease from another worker and that worker trying to update the lease and discovering that another worker has taken it, either by periodic refreshing or by checkpointing.
After this initial lease division, though, this will not happen anymore. When the workers are restarted, they resume the leases they had previously. But when a worker is down for a long time, other workers will take over its leases.
Kinesis has an at-least-once processing model because of this. It is best to design your application so that operations on the data are idempotent.
Scaling is useful if you want to be fault-tolerant (other workers will take over from a failed worker) or your data processing is so time-consuming that one worker would not be able to cope with 20 shards. Scaling beyond the number of shards is indeed only useful for fault-tolerance purposes.
QUESTION
I am listening to aws kinesis streams and enabled error handling globally and specific to channel as below.
Application Yml
...ANSWER
Answered 2018-Feb-23 at 17:47You know it works as designed. Only the problem that it's not so obvious.
I have just pushed an integration test to the Kinesis Binder project.
You can find it in the KinesisBinderProcessorTests
.
But general idea is like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install kinesis-consumer
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page