Skip to content

KinesisMessageDrivenChannelAdapter doesn't read from all shards #175

@0x006EA1E5

Description

@0x006EA1E5

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions