aliehsaeedii opened a new pull request, #22636: URL: https://github.com/apache/kafka/pull/22636
## Summary Implements the client-side surface of [KIP-1331](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1331%3A+Streams+Group+Topology+Description+Plugin) ([KAFKA-20626](https://issues.apache.org/jira/browse/KAFKA-20626)), on top of the already-defined `StreamsGroupDescribe` v1 schema (`IncludeTopologyDescription` / `TopologyDescription` / `TopologyDescriptionStatus`). ### Admin client - **`StreamsGroupTopologyDescription`** — admin POJO mirroring `org.apache.kafka.streams.TopologyDescription` (Subtopology, Source/Processor/Sink nodes, GlobalStore) but string-based, so callers don't depend on `kafka-streams`. The wire format only carries successors; **predecessor edges are reconstructed** from the successor lists when the description is built. - **`StreamsGroupTopologyDescriptionStatus`** — enum `NOT_REQUESTED(0)`/`NOT_STORED(1)`/`ERROR(2)`/`AVAILABLE(3)` with `id()`/`forId()`. - Extended **`StreamsGroupDescription`** with `topologyDescription()` (`Optional`) and `topologyDescriptionStatus()`. The new fields are added via an additive constructor; the existing constructor defaults to `NOT_REQUESTED`/empty, preserving backward compatibility. - Extended **`DescribeStreamsGroupsOptions`** with `includeTopologyDescription(boolean)`. - **`DescribeStreamsGroupsHandler`** sets the request flag, parses the topology (including the global-store source→processor pair), and populates the description only when the status is `AVAILABLE`. `KafkaAdminClient` passes the option through. - Implemented **`MockAdminClient.describeStreamsGroups`** (with `addStreamsGroupDescription`). ### CLI (`kafka-streams-groups.sh`) - New `--describe --topology` sub-action (mutually exclusive with `--members`/`--offsets`/`--state`). - **`TopologyDescriptionFormatter`** renders output mirroring `Topology#describe()`, with sorted node/topic/store sets for stable output. - Exit code `0` for `AVAILABLE`, `1` for `NOT_STORED`/`ERROR`. ### Tests & docs - `DescribeStreamsGroupsHandlerTest`, `TopologyDescriptionFormatterTest`, and CLI coverage in `StreamsGroupCommandTest` (available → exit 0 + correct output + option captured; not-stored → exit 1). - Documented the new option in `kafka-streams-group-sh.md`. ### Note `StreamsGroupDescribeRequest.json` v1 remains `latestVersionUnstable: true` (per its own comment, it flips when the broker topology-description manager lands). Until then, `--topology` against a live cluster surfaces `UnsupportedVersionException`, which is the KIP's documented compatibility behavior. Unit tests construct the request/response directly and are unaffected. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
