use of org.apache.kafka.common.message.CreateTopicsRequestData.CreateableTopicConfig in project kafka by apache.
the class RequestResponseTest method createCreateTopicRequest.
private CreateTopicsRequest createCreateTopicRequest(short version, boolean validateOnly) {
CreateTopicsRequestData data = new CreateTopicsRequestData().setTimeoutMs(123).setValidateOnly(validateOnly);
data.topics().add(new CreatableTopic().setNumPartitions(3).setReplicationFactor((short) 5));
CreatableTopic topic2 = new CreatableTopic();
data.topics().add(topic2);
topic2.assignments().add(new CreatableReplicaAssignment().setPartitionIndex(0).setBrokerIds(asList(1, 2, 3)));
topic2.assignments().add(new CreatableReplicaAssignment().setPartitionIndex(1).setBrokerIds(asList(2, 3, 4)));
topic2.configs().add(new CreateableTopicConfig().setName("config1").setValue("value1"));
return new CreateTopicsRequest.Builder(data).build(version);
}
Aggregations