Search in sources :

Example 6 with StreamConsumerFakeKinesis

use of org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.StreamConsumerFakeKinesis in project flink by apache.

the class StreamConsumerRegistrarTest method testRegisterStreamConsumerTimeoutWaitingForConsumerToBecomeActive.

@Test
public void testRegisterStreamConsumerTimeoutWaitingForConsumerToBecomeActive() throws Exception {
    thrown.expect(FlinkKinesisTimeoutException.class);
    thrown.expectMessage("Timeout waiting for stream consumer to become active: name on stream-arn");
    StreamConsumerFakeKinesis kinesis = FakeKinesisFanOutBehavioursFactory.registerExistingConsumerAndWaitToBecomeActive();
    Properties configProps = createEfoProperties();
    configProps.setProperty(REGISTER_STREAM_TIMEOUT_SECONDS, "1");
    FanOutRecordPublisherConfiguration configuration = new FanOutRecordPublisherConfiguration(configProps, singletonList(STREAM));
    StreamConsumerRegistrar registrar = new StreamConsumerRegistrar(kinesis, configuration, backoffFor(1001));
    registrar.registerStreamConsumer(STREAM, "name");
}
Also used : StreamConsumerFakeKinesis(org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.StreamConsumerFakeKinesis) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

StreamConsumerFakeKinesis (org.apache.flink.streaming.connectors.kinesis.testutils.FakeKinesisFanOutBehavioursFactory.StreamConsumerFakeKinesis)6 Test (org.junit.Test)6 FullJitterBackoff (org.apache.flink.streaming.connectors.kinesis.proxy.FullJitterBackoff)4 Properties (java.util.Properties)2