Skip to content

Commit

Permalink
Expose RefreshCoordinator method on ClusterAdmin
Browse files Browse the repository at this point in the history
Allows a ClusterAdmin client instance to be usable after a coordinator change in the cluster,
without requiring the instantiation of a new clinet.

Contributes-to: #3051

Signed-off-by: Edoardo Comar <[email protected]>
  • Loading branch information
edoardocomar committed Dec 31, 2024
1 parent 1358013 commit 23bdeff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ type ClusterAdmin interface {
// Delete a consumer group.
DeleteConsumerGroup(group string) error

// RefreshCoordinator retrieves the coordinator for a consumer group and stores it
// in local cache. This function only works on Kafka 0.8.2 and higher.
RefreshCoordinator(consumerGroup string) error

// Get information about the nodes in the cluster
DescribeCluster() (brokers []*Broker, controllerID int32, err error)

Expand Down Expand Up @@ -1305,3 +1309,7 @@ func (ca *clusterAdmin) RemoveMemberFromConsumerGroup(groupId string, groupInsta
}
return controller.LeaveGroup(request)
}

func (ca *clusterAdmin) RefreshCoordinator(consumerGroup string) error {
return ca.client.RefreshCoordinator(consumerGroup)
}

0 comments on commit 23bdeff

Please sign in to comment.