feat(web): 任务执行前判断pulsar topic和url是否匹配
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user