use of org.apache.kafka.common.message.DescribeProducersRequestData in project kafka by apache.
the class RequestResponseTest method createDescribeProducersRequest.
private DescribeProducersRequest createDescribeProducersRequest(short version) {
DescribeProducersRequestData data = new DescribeProducersRequestData();
DescribeProducersRequestData.TopicRequest topicRequest = new DescribeProducersRequestData.TopicRequest();
topicRequest.setName("test");
topicRequest.partitionIndexes().add(0);
topicRequest.partitionIndexes().add(1);
data.topics().add(topicRequest);
return new DescribeProducersRequest.Builder(data).build(version);
}
use of org.apache.kafka.common.message.DescribeProducersRequestData in project kafka by apache.
the class DescribeProducersHandler method buildRequest.
@Override
public DescribeProducersRequest.Builder buildRequest(int brokerId, Set<TopicPartition> topicPartitions) {
DescribeProducersRequestData request = new DescribeProducersRequestData();
DescribeProducersRequest.Builder builder = new DescribeProducersRequest.Builder(request);
CollectionUtils.groupPartitionsByTopic(topicPartitions, builder::addTopic, (topicRequest, partitionId) -> topicRequest.partitionIndexes().add(partitionId));
return builder;
}
Aggregations