Class ConsumerDelegateCreator

java.lang.Object
org.apache.kafka.clients.consumer.internals.ConsumerDelegateCreator

public class ConsumerDelegateCreator extends Object
ConsumerDelegateCreator implements a quasi-factory pattern to allow the caller to remain unaware of the underlying Consumer implementation that is created. This provides the means by which KafkaConsumer can remain the top-level facade for implementations, but allow different implementations to co-exist under the covers.

The current logic for the ConsumerCreator inspects the incoming configuration and determines if it is using the new consumer group protocol (KIP-848) or if it should fall back to the existing, legacy group protocol. This is based on the presence and value of the group.protocol configuration. If the value is present and equal to "consumer", the AsyncKafkaConsumer will be returned. Otherwise, the LegacyKafkaConsumer will be returned.

Note: this is for internal use only and is not intended for use by end users. Internal users should not attempt to determine the underlying implementation to avoid coding to an unstable interface. Rather, it is the Consumer API contract that should serve as the caller's interface.