Updated on 2025-09-03 GMT+08:00

Querying the Current Producer List of a Topic

Function

This API is used to query the current producer list of a topic.

URI

GET /v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/producers

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Parameter description:

Project ID. For details, see Obtaining a Project ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

instance_id

Yes

String

Definition:

Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body.

Constraints:

N/A

Range:

N/A

Default Value:

N/A

topic

Yes

String

Parameter description:

Topic.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Parameter description:

Offset. The records after this offset will be queried.

Constraints:

N/A

Value range:

≥ 0

Default value:

N/A

limit

No

Integer

Parameter description:

Maximum number of records that can be returned.

Constraints:

N/A

Value range:

1–50

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Integer

Parameter description:

Total number of records.

Value range:

0–10,000

producers

Array of producers objects

Parameter description:

Producer list.

Table 4 producers

Parameter

Type

Description

producer_address

String

Parameter description:

Producer address.

Value range:

N/A

broker_address

String

Parameter description:

Broker address.

Value range:

N/A

join_time

Long

Parameter description:

Join time, which is a Unix timestamp.

Value range:

N/A

Example Requests

Querying the current producer list of a topic

GET https://{endpoint}/v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/producers?offset=0&limit=10

Example Responses

Status code: 200

The current producer list of the topic is queried successfully.

{
  "total" : 3,
  "producers" : [ {
    "producer_address" : "192.0.0.149:40443",
    "broker_address" : "192.0.0.146:9092",
    "join_time" : 1687204743328
  }, {
    "producer_address" : "192.0.0.149:13807",
    "broker_address" : "192.0.0.80:9092",
    "join_time" : 1687204745939
  }, {
    "producer_address" : "192.0.0.149:31876",
    "broker_address" : "192.0.0.71:9092",
    "join_time" : 1687204744934
  } ]
}

Status Codes

Status Code

Description

200

The current producer list of the topic is queried successfully.

Error Codes

See Error Codes.