private void handleTopicCreationResult()

in src/main/java/com/epam/digital/data/platform/starter/kafka/service/StartupKafkaTopicsCreator.java [124:141]


  private void handleTopicCreationResult(String topicName, KafkaFuture<Void> future) {
    try {
      future.get(
          kafkaProperties.getTopicProperties().getCreation().getTimeoutInSeconds(),
          TimeUnit.SECONDS);
    } catch (Exception e) {
      if (e.getCause() instanceof TopicExistsException) {
        log.warn("Topic {} was in missing topics list, but now exists", topicName);
      } else {
        throw new CreateKafkaTopicException(
            String.format(
                "Failed to create topic %s in %d sec",
                topicName,
                kafkaProperties.getTopicProperties().getCreation().getTimeoutInSeconds()),
            e);
      }
    }
  }