Skip to content

Add support for retrieving connector offsets#830

Draft
AfrinKhan02 wants to merge 4 commits into
masterfrom
feat/list-connector-offset
Draft

Add support for retrieving connector offsets#830
AfrinKhan02 wants to merge 4 commits into
masterfrom
feat/list-connector-offset

Conversation

@AfrinKhan02

Copy link
Copy Markdown
Collaborator

Context

Kafka Connect already exposes an endpoint to retrieve the current offsets of a connector.

This change adds support for that capability in Ns4Kafka to retrieve connector offsets directly from the connector API.

This PR focuses on offset retrieval only.

Related work:

Proposed solution

Add a new connector endpoint in Ns4Kafka to retrieve offsets for a given connector.

The goal is to keep the implementation aligned with the existing connector flow:

  • call Kafka Connect through the existing client layer
  • expose the capability through the service layer
  • provide a dedicated controller endpoint for retrieval
  • enforce the same ownership and access control rules as other connector subresources

Implementation

I introduced a dedicated response model for connector offsets and added a new Kafka Connect client call to query /connectors/{connector}/offsets.

I then wired this capability through the connector service so the controller can reuse the existing connector lookup and ownership checks.

On the API side, I added a new endpoint to retrieve offsets for a connector from the namespaced connector API.

The implementation keeps the returned partition and offset payload flexible, since Kafka Connect can return connector-defined structures depending on whether the connector is a source or a sink.

Tests

I added tests for:

  • the Kafka Connect offsets retrieval flow through the connector service
  • the controller endpoint behavior for successful retrieval and connector-not-found handling
  • access control for the new connector offsets subresource in the security rule tests

@AfrinKhan02 AfrinKhan02 requested a review from ThomasCAI-mlv June 7, 2026 12:32
@AfrinKhan02 AfrinKhan02 self-assigned this Jun 7, 2026
@AfrinKhan02 AfrinKhan02 added the feature This issue or pull request contains a new feature label Jun 7, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature This issue or pull request contains a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant