diff --git a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java index d5d4f2e..cff4134 100644 --- a/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java +++ b/service-web/src/main/java/com/lanyuanxiaoyao/service/web/controller/TaskController.java @@ -47,8 +47,14 @@ public class TaskController { boolean scanQueue = StrUtil.contains(mode, "queue"); boolean scanLog = StrUtil.contains(mode, "log"); boolean scanBase = StrUtil.contains(mode, "base"); - if (scanQueue && (StrUtil.isBlank(topic) || StrUtil.isBlank(pulsar))) { - throw new RuntimeException("Pulsar topic or url cannot be empty"); + if (scanQueue) { + if (StrUtil.isBlank(topic) || StrUtil.isBlank(pulsar)) { + throw new RuntimeException("Pulsar topic or url cannot be empty"); + } else { + if (!pulsarService.existsTopic(pulsar, topic)) { + throw new RuntimeException("Pulsar url is not contain the topic"); + } + } } if ((scanLog || scanBase) && StrUtil.isBlank(hdfs)) { throw new RuntimeException("Hdfs path cannot be empty");