class StreamConsumerRegistrar {

	public String registerStreamConsumer(final String stream, final String streamConsumerName) throws ExecutionException, InterruptedException {
		LOG.debug("Registering stream consumer - {}::{}", stream, streamConsumerName);

		int attempt = 1;

		if (configuration.getEfoRegistrationType() == LAZY) {
			registrationBackoff(configuration, backoff, attempt++);
		}

		DescribeStreamResponse describeStreamResponse = kinesisProxyV2Interface.describeStream(stream);
		String streamArn = describeStreamResponse.streamDescription().streamARN();

		LOG.debug("Found stream ARN - {}", streamArn);

		Optional<DescribeStreamConsumerResponse> describeStreamConsumerResponse =
			describeStreamConsumer(streamArn, streamConsumerName);

		if (!describeStreamConsumerResponse.isPresent()) {
			invokeIgnoringResourceInUse(() -> kinesisProxyV2Interface.registerStreamConsumer(streamArn, streamConsumerName));
		}

		String streamConsumerArn = waitForConsumerToBecomeActive(
			describeStreamConsumerResponse.orElse(null), streamArn, streamConsumerName, attempt);

		LOG.debug("Using stream consumer - {}", streamConsumerArn);

		return streamConsumerArn;
	}

	public  StreamConsumerRegistrar(
			final KinesisProxyV2Interface kinesisProxyV2Interface,
			final FanOutRecordPublisherConfiguration configuration,
			final FullJitterBackoff backoff);

}