Kafka Management API
REST interface for managing Apache Kafka — topic operations, message browsing, consumer group management, and cluster health.
| Field | Value |
|---|---|
| Port | 50034 |
| Base Path | /api/v1/kafka |
| OpenAPI | 3.0.1 |
| Spec | Kafka_Management.json |
Topics
| Method | Path | Description | Query Params |
|---|---|---|---|
| GET | /api/v1/kafka/topics | List all topics | includeInternal (bool, default false) |
| POST | /api/v1/kafka/topics | Create topic | — |
| GET | /api/v1/kafka/topics/{topicName} | Get topic details (partitions, config) | — |
| DELETE | /api/v1/kafka/topics/{topicName} | Delete topic and all data | — |
| GET | /api/v1/kafka/topics/{topicName}/messages | Browse messages | partition, offset, limit, keyFilter, valueFilter |
| POST | /api/v1/kafka/topics/{topicName}/truncate | Truncate topic | — |
CreateTopicRequest
{
"name": "string (required)",
"numPartitions": 1,
"replicationFactor": 1,
"configs": {
"retention.ms": "604800000"
}
}
TopicDetailResponse
{
"name": "my-topic",
"partitions": [
{
"partition": 0,
"leader": 1,
"replicas": [1],
"isr": [1],
"beginningOffset": 0,
"endOffset": 1234
}
],
"configs": { "retention.ms": "604800000" }
}
Consumer Groups
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/kafka/groups | List consumer groups |
| GET | /api/v1/kafka/groups/{groupId} | Get group details |
| POST | /api/v1/kafka/groups/{groupId}/reset-offsets | Reset offsets (group must be empty) |
ResetOffsetsRequest
{
"topic": "string (required)",
"strategy": "EARLIEST | LATEST | TO_OFFSET | BY_DURATION",
"offset": 0,
"duration": "PT1H"
}
warning
Offset reset requires the consumer group to have no active members. Returns 400 if members are connected.
Health & Cluster
| Method | Path | Description |
|---|---|---|
| GET | /api/v1/kafka/health | Kafka health check |
| GET | /api/v1/kafka/cluster | Cluster information |
Status Codes
| Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Topic created |
| 400 | Invalid request / group has active members |
| 404 | Topic or group not found |
| 409 | Topic already exists |
Frontend Integration
| File | Purpose |
|---|---|
services/kafkaApi.ts | Topic & consumer group operations |
hooks/useKafkaTopics.ts | React Query hook |