KafkaClientSupplier Contract — Suppliers of Kafka AdminClient, Consumers and Producers

KafkaClientSupplier is the contract of Kafka client suppliers that provide (supply) Kafka clients, i.e. AdminClient, Kafka Consumers (getConsumer, getGlobalConsumer and getRestoreConsumer) and a Kafka Producer.

Table 1. KafkaClientSupplier Contract
Method Description

getAdminClient

AdminClient getAdminClient(
  final Map<String, Object> config)

A Kafka AdminClient (for KafkaStreams)

Used exclusively when KafkaStreams is created

getConsumer

Consumer<byte[], byte[]> getConsumer(
  final Map<String, Object> config)

A Kafka Consumer (for TaskManager and StreamThread)

Used exclusively when StreamThread is created (that also sets the Kafka Consumer for the TaskManager)

getGlobalConsumer

Consumer<byte[], byte[]> getGlobalConsumer(
  final Map<String, Object> config)

Used exclusively when KafkaStreams is created (for the only purpose of creating a GlobalStreamThread)

getProducer

Producer<byte[], byte[]> getProducer(
  final Map<String, Object> config)

A Kafka Producer (for StreamThreads and TaskCreator)

Used when:

getRestoreConsumer

Consumer<byte[], byte[]> getRestoreConsumer(
  final Map<String, Object> config)

Used exclusively when StreamThread is created

Note
DefaultKafkaClientSupplier is the one and only known implementation of the KafkaClientSupplier Contract.

results matching ""

    No results matching ""