Bird
0
0

Which of the following is the correct syntax to find the controller broker ID using Kafka's AdminClient in Java?

easy📝 Syntax Q3 of 15
Kafka - Cluster Architecture

Which of the following is the correct syntax to find the controller broker ID using Kafka's AdminClient in Java?

AadminClient.getControllerId();
BadminClient.controller().getId();
CadminClient.describeCluster().controller().get().id();
DadminClient.describeController().id();
Step-by-Step Solution
Solution:
  1. Step 1: Recall AdminClient API for controller info

    The correct method chain is describeCluster().controller().get().id() to get controller ID.
  2. Step 2: Check each option's syntax

    Only adminClient.describeCluster().controller().get().id(); matches the official Kafka AdminClient syntax.
  3. Final Answer:

    adminClient.describeCluster().controller().get().id(); -> Option C
  4. Quick Check:

    AdminClient controller ID syntax = describeCluster().controller().get().id() [OK]
Quick Trick: Use describeCluster().controller().get().id() to get controller ID [OK]
Common Mistakes:
  • Using non-existent methods like getControllerId()
  • Incorrect chaining like controller().getId()
  • Confusing describeController() with describeCluster()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes