Update apache-kafka-2/src/test/java/com/baeldung/kafka/message/ordering/SinglePartitionIntegrationTest.java

Co-authored-by: Liam Williams <liam.williams@zoho.com>
This commit is contained in:
Amol Gote 2023-11-04 16:46:09 -04:00 committed by GitHub
parent 45bc3d94d4
commit 1394665355
1 changed files with 1 additions and 12 deletions

View File

@ -68,18 +68,7 @@ public class SinglePartitionIntegrationTest {
admin = Admin.create(adminProperties);
List<NewTopic> topicList = new ArrayList<>();
NewTopic newTopic = new NewTopic(Config.SINGLE_PARTITION_TOPIC, Config.SINGLE_PARTITION, Config.REPLICATION_FACTOR);
topicList.add(newTopic);
CreateTopicsResult result = admin.createTopics(topicList);
KafkaFuture<Void> future = result.values().get(Config.SINGLE_PARTITION_TOPIC);
future.whenComplete((voidResult, exception) -> {
if (exception != null) {
System.err.println("Error creating the topic: " + exception.getMessage());
} else {
System.out.println("Topic created successfully!");
}
}).get();
admin.createTopics(ImmutableList.of(new NewTopic(Config.SINGLE_PARTITION_TOPIC, Config.SINGLE_PARTITION, Config.REPLICATION_FACTOR))).all().get();
}
@AfterAll