On startup, if the metadata table is being created for the
first time, loadShardIDsFromDynamo() call in refreshShards()
will always return an empty shard list.
This causes the consumer to wait until the next leader
election to start receiving events, because that's the only
time loadShardIDsFromKinesis() is called. By default, this happens
once a minute, which means the consumer basically sleeps for 1
minute on first run.
This commit fixes that by adding a first run flag and skipping the
cache if it's true.
On startup, if the metadata table is being created for the first time,
loadShardIDsFromDynamo()
call inrefreshShards()
will always return an empty shard list.This causes the consumer to wait until the next leader election to start receiving events, because that's the only time
loadShardIDsFromKinesis()
is called. By default, this happens once a minute, which means the consumer basically sleeps for 1 minute on first run.This commit fixes that by adding a first run flag and skipping the cache if it's true.
Fixes #17.