Search in sources :

Example 6 with DeletableGroupResultCollection

use of org.apache.kafka.common.message.DeleteGroupsResponseData.DeletableGroupResultCollection in project kafka by apache.

the class DeleteGroupsRequest method getErrorResponse.

@Override
public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) {
    Errors error = Errors.forException(e);
    DeletableGroupResultCollection groupResults = new DeletableGroupResultCollection();
    for (String groupId : data.groupsNames()) {
        groupResults.add(new DeletableGroupResult().setGroupId(groupId).setErrorCode(error.code()));
    }
    return new DeleteGroupsResponse(new DeleteGroupsResponseData().setResults(groupResults).setThrottleTimeMs(throttleTimeMs));
}
Also used : Errors(org.apache.kafka.common.protocol.Errors) DeletableGroupResult(org.apache.kafka.common.message.DeleteGroupsResponseData.DeletableGroupResult) DeleteGroupsResponseData(org.apache.kafka.common.message.DeleteGroupsResponseData) DeletableGroupResultCollection(org.apache.kafka.common.message.DeleteGroupsResponseData.DeletableGroupResultCollection)

Aggregations

DeleteGroupsResponseData (org.apache.kafka.common.message.DeleteGroupsResponseData)6 DeletableGroupResult (org.apache.kafka.common.message.DeleteGroupsResponseData.DeletableGroupResult)6 DeletableGroupResultCollection (org.apache.kafka.common.message.DeleteGroupsResponseData.DeletableGroupResultCollection)6 DeleteGroupsResponse (org.apache.kafka.common.requests.DeleteGroupsResponse)4 Test (org.junit.jupiter.api.Test)4 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 ApiVersion (org.apache.kafka.common.message.ApiVersionsResponseData.ApiVersion)2 MockTime (org.apache.kafka.common.utils.MockTime)2 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 MockClient (org.apache.kafka.clients.MockClient)1 Cluster (org.apache.kafka.common.Cluster)1 Errors (org.apache.kafka.common.protocol.Errors)1 Time (org.apache.kafka.common.utils.Time)1