FindCoordinatorResponseHandler

FindCoordinatorResponseHandler is a concrete RequestFutureAdapter of ClientResponse.

FindCoordinatorResponseHandler is used exclusively when AbstractCoordinator is requested to discover the coordinator for a consumer group (and when successful sets the group coordinator as a Kafka node with the hostname and the port).

Performing Response Conversion on Success — onSuccess Method

void onSuccess(ClientResponse resp, RequestFuture<Void> future)
Note
onSuccess is part of the RequestFutureAdapter Contract to perform a type conversion when a RequestFuture completes with a success.

onSuccess prints out the following DEBUG message to the logs:

Received FindCoordinator response [resp]

onSuccess takes the FindCoordinatorResponse (from the given ClientResponse) and branches off per error.

No Error

With no error, onSuccess sets the group coordinator (as a Kafka node with the hostname and the port).

onSuccess prints out the following INFO message to the logs:

Discovered group coordinator [coordinator]

In the end, onSuccess requests the Heartbeat to resetSessionTimeout and completes the given RequestFuture<Void>.

GROUP_AUTHORIZATION_FAILED Error

In case of GROUP_AUTHORIZATION_FAILED error, onSuccess raises a GroupAuthorizationException in the given RequestFuture<Void>.

Other Errors

All other errors lead onSuccess to print out the following DEBUG message to the logs and raise the error in the given RequestFuture<Void>.

Group coordinator lookup failed: [message]

Performing Response Conversion on Failure — onFailure Method

void onFailure(RuntimeException e, RequestFuture<Void> future)
Note
onFailure is part of the RequestFutureAdapter Contract to perform a type conversion when a RequestFuture completes with a failure.

onFailure…​FIXME

results matching ""

    No results matching ""