ADDED Requirements

Requirement: Readiness-gating library module

The example repo SHALL contain a standalone library module providing an annotation to mark Kafka listener methods as config consumers, tracking per-listener last-consumed-time and error state, and exposing a “fully consumed” state (no new messages for a configurable N seconds AND no consume errors) integrated with Spring Boot’s readiness state.

Scenario: Readiness stays DOWN until fully consumed

Scenario: Readiness flips UP after quiet period

Requirement: Local cache consumption from compacted topic

The main app module SHALL consume the compacted topic into an in-memory, thread-safe local cache using the readiness-gating library, and SHALL treat a record with a null value as a tombstone that removes (or marks inactive) the corresponding cache entry.

Scenario: Cache populated from topic

Scenario: Tombstone removes entry

Requirement: Cache-backed scheduled job and endpoint

The app module SHALL expose one @Scheduled job and one HTTP endpoint, both reading from the local cache, demonstrating consumption of cached data after readiness.

Scenario: Endpoint reflects cache contents

Requirement: Per-pod consumer group via ConfigMap-templated env var

Each app pod SHALL run with a distinct Kafka consumer group name, generated by templating a UUID into an env var sourced from a Kubernetes ConfigMap and resolved via Spring Boot property placeholder resolution.

Scenario: Distinct consumer groups across pods

Requirement: KRaft-mode Kafka with UI

The deployment SHALL run Kafka in KRaft mode (no ZooKeeper) alongside a Kafka UI reachable from the reader’s browser via minikube for inspecting topics and consumer groups.

Scenario: Kafka UI shows topic and consumer groups

Requirement: Compacted topic pre-populated outside the app

The compacted topic SHALL be created with cleanup.policy=compact and pre-populated with sample data by a step that runs independently of the application (init container, Kubernetes Job, or Makefile bootstrap step using the Kafka CLI), not by application code.

Scenario: Topic exists and has data before app starts consuming

Requirement: One-command minikube deployment

The example repo SHALL provide Makefile targets (or a documented equivalent) that build the library, build the app (depending on the library), build the Docker image, and deploy the full stack (Kafka, UI, topic-init, app with multiple replicas) to a running minikube cluster, in dependency order, with a small number of commands.

Scenario: Clean clone reaches a running demo

Requirement: README quick start and observability instructions

The README SHALL document: minikube prerequisites and startup, the one-command deploy path, how the ConfigMap-to-env-var-to-Spring-property consumer group templating works, how to reach and curl the cache-backed endpoint (including exposing the Service via minikube), how to observe per-pod consumer groups and the compacted topic in the Kafka UI, how tombstone deletes behave, and how to scale replicas to observe broadcast behavior.

Scenario: README covers all required topics