class StreamConsumerRegistrar {

	public void deregisterStreamConsumer(final String stream) throws InterruptedException, ExecutionException {
		LOG.debug("Deregistering stream consumer - {}", stream);

		int attempt = 1;
		String streamConsumerArn = getStreamConsumerArn(stream);

		deregistrationBackoff(configuration, backoff, attempt++);

		Optional<DescribeStreamConsumerResponse> response = describeStreamConsumer(streamConsumerArn);
		if (response.isPresent() && response.get().consumerDescription().consumerStatus() != DELETING) {
			invokeIgnoringResourceInUse(() -> kinesisProxyV2Interface.deregisterStreamConsumer(streamConsumerArn));
		}

		waitForConsumerToDeregister(response.orElse(null), streamConsumerArn, attempt);

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

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

}