use of org.apache.flink.streaming.connectors.kinesis.internals.publisher.fanout.FanOutRecordPublisherFactory in project flink by apache.
the class ShardConsumerFanOutTest method testShardConsumerExitsWhenRecordPublisherIsInterrupted.
@Test
public void testShardConsumerExitsWhenRecordPublisherIsInterrupted() throws Exception {
// Throws error after 5 records
KinesisProxyV2Interface kinesis = FakeKinesisFanOutBehavioursFactory.errorDuringSubscription(new SdkInterruptedException(null));
int expectedNumberOfRecordsReadFromKinesisBeforeError = 5;
SequenceNumber startingSequenceNumber = new SequenceNumber("0");
SequenceNumber expectedLastProcessSequenceNumber = new SequenceNumber("5");
// SdkInterruptedException will terminate the consumer, it will not retry and read only the
// first 5 records
ShardConsumerTestUtils.assertNumberOfMessagesReceivedFromKinesis(expectedNumberOfRecordsReadFromKinesisBeforeError, new FanOutRecordPublisherFactory(kinesis), startingSequenceNumber, efoProperties(), expectedLastProcessSequenceNumber);
}
Aggregations