use of org.apache.kafka.common.message.DescribeProducersRequestData.TopicRequest in project kafka by apache.
the class DescribeProducersRequest method getErrorResponse.
@Override
public DescribeProducersResponse getErrorResponse(int throttleTimeMs, Throwable e) {
Errors error = Errors.forException(e);
DescribeProducersResponseData response = new DescribeProducersResponseData();
for (TopicRequest topicRequest : data.topics()) {
TopicResponse topicResponse = new TopicResponse().setName(topicRequest.name());
for (int partitionId : topicRequest.partitionIndexes()) {
topicResponse.partitions().add(new PartitionResponse().setPartitionIndex(partitionId).setErrorCode(error.code()));
}
response.topics().add(topicResponse);
}
return new DescribeProducersResponse(response);
}
Aggregations