DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Status
Current state: Under Discussion
Discussion thread: https://lists.apache.org/thread/7vkpl9k0wxdtm170xbq77o00z52h66yy
JIRA:KAFKA-20392
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
The current GET /connectors endpoint in Kafka Connect supports an expand query parameter that changes the shape of the response:
- Without
expand: returns a list of connector names - With
expand: returns a map of connector → expanded details
This creates a non-uniform API contract, where the same endpoint produces incompatible response schemas depending on query parameters.
This causes issues for:
- Generated clients (OpenAPI / strongly typed clients)
- API consumers expecting stable schemas
- Documentation clarity and long-term maintainability
More importantly, this violates a core REST principle:
A single endpoint should have a predictable response structure.
This KIP proposes to separate the concerns:
- Keep
/connectorsas a stable, simple listing endpoint - Introduce a new endpoint for expanded connector metadata
This is the problem described in KAFKA-20392.
Goals
- One predictable response type per endpoint for the scope of this KIP (strict list vs. expanded map).
- Preserve all behavior currently available through
expand(no capability loss). - Improve clarity for clients and schema tooling.
- Provide a migration path without a breaking change in the first release.
Non-goals
- Redesigning the broader Connect REST API.
- Changing connector runtime behavior or semantics.
- Forcing every client to migrate in a single release.
Public interfaces
REST API
GET /connectors
- Response: JSON array of connector name strings only (unchanged shape when
expandis absent). expand: Not part of the long-term contract on this URL.- From the release that introduces
GET /connectors-details: requests that includeexpandstill behave as today (expanded map) for one major release only; implementations MUST log a WARN on each such request with text that namesGET /connectors-detailsas the replacement. - Starting the next major release: requests to
GET /connectorsthat includeexpandwill ignore it and will return list of connectors.
- From the release that introduces
- Media type:
application/json.
GET /connectors-details (new)
- Purpose: Sole supported URL for the expanded map response.
- Query parameters: Same as today:
expand=status,expand=info, repeatedexpandfor multiple values; unknown values ignored/logged as today. - Response: Same JSON object shape as today’s
GET /connectors?expand=...(connector name → object with optionalstatus/infoentries).
Documentation / OpenAPI
- Document
GET /connectorsas array only in the steady state after deprecation; document the one-major-release warning window. - Document
GET /connectors-detailswith a single fixed response schema (object map). Update public Connect REST documentation and OpenAPI to reflect deprecation of
expandonGET /connectors, the warning window, and the newGET /connectors-detailsendpoint.
Monitoring
- Required for the deprecation window: WARN log when
expandis used onGET /connectors
Proposed Changes
New Endpoint
Introduce a new endpoint:
GET /connectors-details
This endpoint returns expanded connector metadata.
Supported query parameters:
expand=status
expand=info
expand=status&expand=info
Response Format
Example:
{
"my-source": {
"status": {
"name": "my-source",
"connector": {
"state": "RUNNING",
"worker_id": "worker1:8083"
},
"tasks": [
{ "id": 0, "state": "RUNNING", "worker_id": "worker1:8083" }
],
"type": "source"
},
"info": {
"name": "my-source",
"config": {
"connector.class": "org.apache.kafka.connect.file.FileStreamSourceConnector",
"tasks.max": "1",
"topic": "my-topic",
"file": "/tmp/test.txt"
},
"tasks": [
{ "connector": "my-source", "task": 0 }
],
"type": "source"
}
}
}
This response will be same as current response for /connectors?expand=status&expand=info
Compatibility and Migration Plan
Release N (Introduction Phase)
| Endpoint | Behavior |
|---|---|
GET /connectors | Returns list of names |
GET /connectors?expand=... | Still supported (deprecated) |
GET /connectors-details | New endpoint |
Additional behavior:
- Log warning when
expandis used on/connectors
Release N+1 (Deprecation Enforcement Phase)
| Endpoint | Behavior |
|---|---|
GET /connectors | Returns list only |
GET /connectors?expand=... | Returns list only |
GET /connectors-details | Fully supported |
Rationale
This phased approach:
- Preserves backward compatibility
- Provides clear migration path
- Aligns with existing Kafka API evolution practices
Test plan
- Unit: Assert
GET /connectorswith no query returnsList<String>; assertGET /connectors-detailsreturns the map forstatus,info, and both; assert in N+1 behavior tests thatGET /connectors?expand=statusyields list of connectors . - Regression: Preserve existing edge-case tests for expansion (e.g. connector not found while building the map) on the new path.
Rejected Alternatives
- Documentation only — does not remove union-type responses on
GET /connectorsfor clients that must support both modes today. - Wrapper on
GET /connectors(e.g.{ "names": [...], "details": {...} }) — breaks existing clients that expect a bare JSON array. - Content negotiation (
Accept) — harder to use and operate; still overloads one resource compared to two explicit URLs.