Skip to content


Creating Instance

KafkaApis takes the following to be created:

  • RequestChannel
  • MetadataSupport
  • ReplicaManager
  • GroupCoordinator
  • TransactionCoordinator
  • AutoTopicCreationManager
  • Broker ID
  • KafkaConfig
  • ConfigRepository
  • MetadataCache
  • Metrics
  • Optional Authorizer
  • QuotaManagers
  • FetchManager
  • BrokerTopicStats
  • Cluster ID
  • Time
  • DelegationTokenManager
  • ApiVersionManager

KafkaApis is created when:


KafkaApis is given a TransactionCoordinator when created.

The TransactionCoordinator is used for the following:


  request: RequestChannel.Request): Unit

handleInitProducerIdRequest assumes that the given RequestChannel.Request is an InitProducerIdRequest.

handleInitProducerIdRequest authorizes the request.

With producerId and producerEpoch set either to -1s (NO_PRODUCER_ID and NO_PRODUCER_EPOCH) or some non--1 values, handleInitProducerIdRequest requests the TransactionCoordinator to handleInitProducerId.

Otherwise, handleInitProducerIdRequest sends an error back.

handleInitProducerIdRequest is used when:


  request: RequestChannel.Request): Unit

handleFetchRequest assumes that the given RequestChannel.Request is an FetchRequest.

handleFetchRequest authorizes the request.

In the end, handleFetchRequest requests the ReplicaManager to fetchMessages.

handleFetchRequest is used when:

Back to top