Get partition details of an Apache Kafka® topic
Use one of three available approaches to retrieve partition details of an Apache Kafka® topic.
With Aiven console
In the Aiven Console follow these steps:
- Log in to Aiven Console and select your Aiven for Apache Kafka service.
- Select Topics from the left sidebar.
- Select a specific topic in the Topics screen or click the ellipsis (More options).
- On the Topics info screen, select Partitions to view detailed information about the partitions.
With Aiven API
Retrieve topic details with an API call using the endpoint to get Kafka topic info.
Learn more about API usage in the Aiven API overview.
With Aiven CLI
Retrieve topic details by using Aiven CLI commands. Find the full list
of commands for avn service topic
in
the CLI reference.
For example, this bash script, with a help of jq
utility, lists topics
and their details for a specified Apache Kafka service:
#!/bin/bash
proj=${1:-YOUR-AIVEN-PROJECT-NAME}
serv="${2:-YOUR-KAFKA-SERVICE-NAME}"
cloud=$(avn service get --project $proj $serv --json | jq -r '.cloud_name')
topics=$(avn service topic-list --project $proj $serv --json | jq -r '.[] | .topic_name')
echo "Cloud: $cloud Service: $serv"
for topic in $topics
do
echo "Topic: $topic"
avn service topic-get --project $proj $serv $topic
done