diff --git a/build.gradle b/build.gradle index 9b96e20..67a082f 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ repositories { ext { assertjVersion = '3.24.2' awaitilityVersion = '4.2.0' - awsSdkVersion = '2.20.32' + awsSdkVersion = '2.20.35' jacksonVersion = '2.14.2' junitVersion = '5.9.2' log4jVersion = '2.19.0' diff --git a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java index eb0bd5b..fd1617c 100644 --- a/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java +++ b/src/main/java/org/springframework/integration/aws/inbound/kinesis/KclMessageDrivenChannelAdapter.java @@ -52,6 +52,7 @@ import software.amazon.kinesis.processor.RecordProcessorCheckpointer; import software.amazon.kinesis.processor.ShardRecordProcessor; import software.amazon.kinesis.processor.ShardRecordProcessorFactory; import software.amazon.kinesis.processor.SingleStreamTracker; +import software.amazon.kinesis.processor.StreamTracker; import software.amazon.kinesis.retrieval.KinesisClientRecord; import software.amazon.kinesis.retrieval.RetrievalConfig; @@ -239,17 +240,23 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport { @Override protected void onInit() { super.onInit(); + this.config = + new ConfigsBuilder(buildStreamTracker(), + this.consumerGroup, + this.kinesisClient, + this.dynamoDBClient, + this.cloudWatchClient, + this.workerId, + this.recordProcessorFactory); + } + private StreamTracker buildStreamTracker() { if (this.streams.length == 1) { - this.config = new ConfigsBuilder( - new SingleStreamTracker( - StreamIdentifier.singleStreamInstance(this.streams[0]), this.streamInitialSequence), - this.consumerGroup, this.kinesisClient, this.dynamoDBClient, this.cloudWatchClient, this.workerId, - this.recordProcessorFactory); + return new SingleStreamTracker(StreamIdentifier.singleStreamInstance(this.streams[0]), + this.streamInitialSequence); } else { - this.config = new ConfigsBuilder(new StreamsTracker(), this.consumerGroup, this.kinesisClient, - this.dynamoDBClient, this.cloudWatchClient, this.workerId, this.recordProcessorFactory); + return new StreamsTracker(); } }