From f3b0dad41ee2347ab183582a0dde12267ade24ad Mon Sep 17 00:00:00 2001 From: Justin Pfifer Date: Thu, 27 Sep 2018 12:29:13 -0700 Subject: [PATCH] Don't check the continuation sequence number if it's null (#426) Would cause shard end handling to fail. Also advanced the version --- amazon-kinesis-client-multilang/pom.xml | 2 +- amazon-kinesis-client/pom.xml | 2 +- .../ExperimentalFanOutRecordsPublisher.java | 12 +++++++----- pom.xml | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/amazon-kinesis-client-multilang/pom.xml b/amazon-kinesis-client-multilang/pom.xml index 83c1313f0..649528078 100644 --- a/amazon-kinesis-client-multilang/pom.xml +++ b/amazon-kinesis-client-multilang/pom.xml @@ -19,7 +19,7 @@ amazon-kinesis-client-pom software.amazon.kinesis - 2.0.3-experimental-6 + 2.0.3-experimental-7 4.0.0 diff --git a/amazon-kinesis-client/pom.xml b/amazon-kinesis-client/pom.xml index d177b6b86..3e4caaffa 100644 --- a/amazon-kinesis-client/pom.xml +++ b/amazon-kinesis-client/pom.xml @@ -20,7 +20,7 @@ software.amazon.kinesis amazon-kinesis-client-pom - 2.0.3-experimental-6 + 2.0.3-experimental-7 amazon-kinesis-client diff --git a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/retrieval/fanout/experimental/ExperimentalFanOutRecordsPublisher.java b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/retrieval/fanout/experimental/ExperimentalFanOutRecordsPublisher.java index e6cd9abda..968d90935 100644 --- a/amazon-kinesis-client/src/main/java/software/amazon/kinesis/retrieval/fanout/experimental/ExperimentalFanOutRecordsPublisher.java +++ b/amazon-kinesis-client/src/main/java/software/amazon/kinesis/retrieval/fanout/experimental/ExperimentalFanOutRecordsPublisher.java @@ -62,11 +62,13 @@ protected void validateRecords(String shardId, SubscribeToShardEvent event) { throw new IllegalArgumentException(mismatchReport); } - Map continuationMismatch = mismatchedRecordReporter.recordsNotForShard(shardId, Stream.of(event.continuationSequenceNumber())); - if (!continuationMismatch.isEmpty()) { - String continuationReport = "Continuation sequence number not matched to shard: " + mismatchedRecordReporter.makeReport(continuationMismatch); - log.error(continuationReport); - throw new IllegalArgumentException(continuationReport); + if (event.continuationSequenceNumber() != null) { + Map continuationMismatch = mismatchedRecordReporter.recordsNotForShard(shardId, Stream.of(event.continuationSequenceNumber())); + if (!continuationMismatch.isEmpty()) { + String continuationReport = "Continuation sequence number not matched to shard: " + mismatchedRecordReporter.makeReport(continuationMismatch); + log.error(continuationReport); + throw new IllegalArgumentException(continuationReport); + } } } diff --git a/pom.xml b/pom.xml index 172628c9e..8b1b3c4d2 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ amazon-kinesis-client-pom pom Amazon Kinesis Client Library - 2.0.3-experimental-6 + 2.0.3-experimental-7 The Amazon Kinesis Client Library for Java enables Java developers to easily consume and process data from Amazon Kinesis.