Upgrade dependencies; prepare for release

Fixes https://github.com/spring-projects/spring-integration-aws/issues/162

* Fix deprecations
This commit is contained in:
Artem Bilan
2020-10-29 11:45:34 -04:00
parent 8a959d0db4
commit 10d4652c21
4 changed files with 26 additions and 13 deletions

View File

@@ -64,6 +64,7 @@ import com.amazonaws.services.kinesis.clientlibrary.interfaces.IRecordProcessorF
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.InitialPositionInStream;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.KinesisClientLibConfiguration;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShutdownReason;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.SimpleRecordsFetcherFactory;
import com.amazonaws.services.kinesis.clientlibrary.lib.worker.Worker;
import com.amazonaws.services.kinesis.model.Record;
@@ -273,6 +274,7 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport {
new KinesisClientLibConfiguration(this.consumerGroup,
this.stream,
null,
null,
this.streamInitialSequence,
this.kinesisProxyCredentialsProvider,
null,
@@ -294,8 +296,11 @@ public class KclMessageDrivenChannelAdapter extends MessageProducerSupport {
KinesisClientLibConfiguration.DEFAULT_VALIDATE_SEQUENCE_NUMBER_BEFORE_CHECKPOINTING,
null,
KinesisClientLibConfiguration.DEFAULT_SHUTDOWN_GRACE_MILLIS,
KinesisClientLibConfiguration.DEFAULT_DDB_BILLING_MODE
);
KinesisClientLibConfiguration.DEFAULT_DDB_BILLING_MODE,
new SimpleRecordsFetcherFactory(),
0,
0,
0);
}
this.consumerGroup = this.config.getApplicationName();

View File

@@ -577,7 +577,7 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
try {
Thread.sleep(this.describeStreamBackoff);
readShardList(stream, retryCount++);
readShardList(stream, retryCount + 1);
}
catch (InterruptedException ex) {
Thread.currentThread().interrupt();
@@ -653,10 +653,10 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
String exceptionMessage = "Got an exception when processing shards in stream [" + stream + "]";
logger.info(exceptionMessage + ".\n Retrying... ", e);
if (retry > 5) {
throw new IllegalStateException("Error processing shards in stream [\" + stream + \"].", e);
throw new IllegalStateException(exceptionMessage, e);
}
//Retry
detectShardsToConsume(stream, retry++);
detectShardsToConsume(stream, retry + 1);
sleep(this.describeStreamBackoff, new IllegalStateException(exceptionMessage), false);
}
@@ -694,6 +694,9 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
}
}
}
catch (Exception ex) {
logger.error("Error population shards for stream: " + stream, ex);
}
finally {
if (shardsGatherLatch != null) {
shardsGatherLatch.countDown();
@@ -866,6 +869,7 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
public boolean isLongLived() {
return true;
}
}
private final class ShardConsumer {
@@ -1268,6 +1272,7 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
public String toString() {
return "ShardConsumer{" + "shardOffset=" + this.shardOffset + ", state=" + this.state + '}';
}
}
private final class ConsumerInvoker implements SchedulingAwareRunnable {
@@ -1346,6 +1351,7 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
public boolean isLongLived() {
return true;
}
}
private final class ShardConsumerManager implements SchedulingAwareRunnable {
@@ -1445,5 +1451,7 @@ public class KinesisMessageDrivenChannelAdapter extends MessageProducerSupport
public boolean isLongLived() {
return true;
}
}
}