Learn Labs
5. Managing Apache Kafka Programmatically (AdminClient)

5.11 Self-test

Self-test31 questions

—/31
  1. Before AdminClient existed, what were the three ways to handle "the topic might not exist," and what was wrong with each?

  2. AdminClient Futures complete when what is true — and what is not guaranteed at that moment?

  3. Which broker handles mutations? Which handles reads? What debugging symptom does that asymmetry produce?

  4. Why must you always inspect e.getCause() on an ExecutionException?

  5. What does close(Duration) do differently from close()?

  6. You use a DNS alias for bootstrap and SASL auth fails. Why, and what's the fix?

  7. Your Kubernetes clients can't connect though brokers are healthy. Why, and what's the fix?

  8. Why is request.timeout.ms defaulted to 120 s, and when should you lower it? Describe the startup-validation pattern.

  9. Kafka Connect's config topic requires 1 partition, 3 replicas, and compaction. Give the reason for each.

  10. What does TopicDescription contain — and what notable thing does it not contain?

  11. What race produces TopicExistsException, and how should you handle it?

  12. Why is topic deletion described as needing "extra care"? What broker config guards it?

  13. When is blocking .get() the wrong choice, and what replaces it?

  14. isDefault() returns false. Name the two different situations that can cause that.

  15. What do APPEND and SUBTRACT exist for, and what hazard do they avoid?

  16. Tell the config-recovery war story. What general principle does it establish?

  17. Give the exact formula for consumer lag and the two API calls it requires.

  18. What are the three OffsetSpec implementations, and what is forTimestamp() used for beyond seeking?

  19. Why is setting offsets preferable to deleting them?

  20. Why does Kafka refuse to modify offsets for an active group? What exception do you get, and what does it really mean?

  21. Explain the shoe-counting double-count. State the general rule about offsets and state.

  22. .valid() vs .errors() vs .all() on listConsumerGroups — when do you want each?

  23. createPartitions takes what number, exactly? What must you do first?

  24. Why does Kafka's retention config not satisfy privacy law, and what two APIs compose into a compliant deletion?

  25. After deleteRecords, what's true immediately and what's only eventually true?

  26. Contrast preferred and unclean leader election. What does each cost you?

  27. In a reassignment replica list like [1,0], what is the significance of the ordering?

  28. How do you cancel an in-flight reassignment? What state does that restore?

  29. What must you be careful about when reassigning replicas, and what tool does the book point you at?

  30. Name two limitations of MockAdminClient, and the Maven detail people miss.

  31. Why is "never use ZooKeeper directly" a forward-compatibility argument rather than a style preference?

    Previous: Chapter 4 — Kafka Consumers Next: Chapter 6 — Kafka Internals