Admin

1 post in this section

KafkaAdmin and AdminClient: Managing Topics Programmatically

Why Manage Topics Programmatically? CLI commands work for one-time setup. Production services need: Startup validation — verify required topics exist before the application starts Auto-provisioning — create topics at deployment time with correct config Dynamic tenant onboarding — create per-tenant topics at runtime Config drift detection — compare actual topic config against expected values Spring Kafka provides KafkaAdmin for declarative topic management and AdminClient for imperative operations. KafkaAdmin — Declarative Topic Creation Declare NewTopic beans — Spring Kafka creates them at startup if they don’t exist:

Continue reading »