Replace duplicate code with existing method

Resolves #2702
This commit is contained in:
조찬형[Plasma]
2023-04-07 13:27:47 +09:00
committed by Oleg Zhurakousky
parent 86df59777b
commit 6c193d6b37

View File

@@ -561,8 +561,7 @@ public class KafkaTopicProvisioner implements
// In some cases, the above partition query may not throw an UnknownTopic..Exception for various reasons.
// For that, we are forcing another query to ensure that the topic is present on the server.
if (CollectionUtils.isEmpty(partitions)) {
try (AdminClient adminClient = AdminClient
.create(this.adminClientProperties)) {
try (AdminClient adminClient = createAdminClient()) {
final DescribeTopicsResult describeTopicsResult = adminClient
.describeTopics(Collections.singletonList(topicName));