Skip to content

Commit

Permalink
[kinesis] Allow configuring initial shard count
Browse files Browse the repository at this point in the history
  • Loading branch information
dzbarsky committed Jul 7, 2023
1 parent 8b0e15f commit ab90ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func main() {
enableKinesis := flag.Bool("enableKinesis", true, "Enable Kinesis service")
kinesisInitialStreams := flag.String("kinesisInitialStreams", "",
"Streams to create at startup. Example: stream1,stream2,stream3")
kinesisInitialShardsPerStream := flag.Int64("kinesisInitialShardsPerStream", 2,
"How many shards to create for each stream listed in -kinesisInitialStreams")
kinesisDefaultDuration := flag.Duration("kinesisDefaultDuration", 24*time.Hour,
"How long to retain messages. Can be used to control memory usage. After creation, retention can be adjusted with [Increase/Decrease]StreamRetentionPeriod")

Expand All @@ -45,7 +47,7 @@ func main() {
for _, name := range strings.Split(*kinesisInitialStreams, ",") {
k.CreateStream(kinesis.CreateStreamInput{
StreamName: name,
ShardCount: 20,
ShardCount: *kinesisInitialShardsPerStream,
})
}
k.RegisterHTTPHandlers(methodRegistry)
Expand Down

0 comments on commit ab90ae2

Please sign in to comment.