-
Notifications
You must be signed in to change notification settings - Fork 168
Description
In what version(s) of Spring Integration are you seeing this issue?
spring-integration-aws v2.3.3.RELEASE
Describe the bug
KinesisMessageDrivenChannelAdapter doesn't read from all shards if the number of shards is greater than the default MaxResults
of 100.
The response from amazonKinesis.listShards(...)
is paginated.
If the number of shards available for a stream is greater than MaxResults
, then the response will include a NextToken
value. This token should then be used in the next request to get the next page.
This should be repeated until all shards have been returned, indicated by the absence of the NextToken
value in the last response.
To Reproduce
Create a kinesis stream with more than 100 shards.
Start KinesisMessageDrivenChannelAdapter for the above stream.
See that only 100 shards are read from.
Or mock the response in a unit test
Or go look at the code here:
Line 544 in ee79a1c
ListShardsResult listShardsResult = this.amazonKinesis.listShards(listShardsRequest); |
And see here https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListShards.html
Expected behavior
We should read from all shards, not just the ones listed in the first page of results