use of org.apache.kafka.common.message.DescribeClusterResponseData.DescribeClusterBroker in project kafka by apache.
the class MessageTest method testDescribeClusterResponseVersions.
@Test
public void testDescribeClusterResponseVersions() throws Exception {
DescribeClusterResponseData data = new DescribeClusterResponseData().setBrokers(new DescribeClusterBrokerCollection(Collections.singletonList(new DescribeClusterBroker().setBrokerId(1).setHost("localhost").setPort(9092).setRack("rack1")).iterator())).setClusterId("clusterId").setControllerId(1).setClusterAuthorizedOperations(10);
testAllMessageRoundTrips(data);
}
use of org.apache.kafka.common.message.DescribeClusterResponseData.DescribeClusterBroker in project kafka by apache.
the class KafkaAdminClientTest method prepareDescribeClusterResponse.
private static DescribeClusterResponse prepareDescribeClusterResponse(int throttleTimeMs, Collection<Node> brokers, String clusterId, int controllerId, int clusterAuthorizedOperations) {
DescribeClusterResponseData data = new DescribeClusterResponseData().setErrorCode(Errors.NONE.code()).setThrottleTimeMs(throttleTimeMs).setControllerId(controllerId).setClusterId(clusterId).setClusterAuthorizedOperations(clusterAuthorizedOperations);
brokers.forEach(broker -> data.brokers().add(new DescribeClusterBroker().setHost(broker.host()).setPort(broker.port()).setBrokerId(broker.id()).setRack(broker.rack())));
return new DescribeClusterResponse(data);
}
Aggregations