pathList) throws Exception {
- CuratorFramework client = zkParserHelper.getZkCuratorFramework(pathList);
-
- String content = new String(client.getData().forPath(nodePath));
-
- zkParserHelper.checkContent(content);
-
- JsonNode ruleObject = convertToJson(content);
-
- parse(ruleObject.toString());
-
- zkParserHelper.listenZkNode(client);
- }
-
- /**
- * 解析一个 chain 的过程
- *
- * @param chain chain
- */
- @Override
- public abstract void parseOneChain(JsonNode chain);
-}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperJsonFlowELParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperJsonFlowELParser.java
deleted file mode 100644
index 2f94ef0d0..000000000
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperJsonFlowELParser.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.yomahub.liteflow.parser.el;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.yomahub.liteflow.parser.base.BaseZookeeperJsonFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-
-/**
- * 基于zk方式的json形式的解析器
- * @author guodongqing
- * @since 2.5.0
- */
-public class ZookeeperJsonFlowELParser extends BaseZookeeperJsonFlowParser {
-
- public ZookeeperJsonFlowELParser(String node) {
- super(node);
- }
-
- @Override
- public void parseOneChain(JsonNode chainObject) {
- ParserHelper.parseOneChainEl(chainObject);
- }
-
-}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperXmlFlowELParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperXmlFlowELParser.java
deleted file mode 100644
index 3c1d06652..000000000
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperXmlFlowELParser.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.yomahub.liteflow.parser.el;
-
-import com.yomahub.liteflow.parser.base.BaseZookeeperXmlFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-import org.dom4j.Element;
-
-/**
- * 基于zk方式的xml形式EL表达式解析器
- * @author Bryan.Zhang
- * @since 2.8.0
- */
-public class ZookeeperXmlFlowELParser extends BaseZookeeperXmlFlowParser {
-
- public ZookeeperXmlFlowELParser(String node) {
- super(node);
- }
-
- @Override
- public void parseOneChain(Element chain) {
- ParserHelper.parseOneChainEl(chain);
- }
-}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperYmlFlowELParser.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperYmlFlowELParser.java
deleted file mode 100644
index 6ad2b37e5..000000000
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/el/ZookeeperYmlFlowELParser.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.yomahub.liteflow.parser.el;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.yomahub.liteflow.parser.base.BaseZookeeperYmlFlowParser;
-import com.yomahub.liteflow.parser.helper.ParserHelper;
-
-/**
- * 基于zk方式的yml形式EL表达式解析器
- *
- * @author Bryan.Zhang
- * @since 2.8.0
- */
-public class ZookeeperYmlFlowELParser extends BaseZookeeperYmlFlowParser {
- public ZookeeperYmlFlowELParser(String node) {
- super(node);
- }
-
- @Override
- public void parseOneChain(JsonNode chain) {
- ParserHelper.parseOneChainEl(chain);
- }
-}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java
index fe6d1d34a..3b651ce84 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/FlowParserProvider.java
@@ -36,24 +36,10 @@ public class FlowParserProvider {
private static final String LOCAL_EL_YML_CONFIG_REGEX = "^[\\w\\:\\-\\@\\/\\\\\\*]+\\.el\\.yml$";
- private static final String FORMAT_EL_XML_CONFIG_REGEX = "el_xml:.+";
-
- private static final String FORMAT_EL_JSON_CONFIG_REGEX = "el_json:.+";
-
- private static final String FORMAT_EL_YML_CONFIG_REGEX = "el_yml:.+";
-
- private static final String FORMAT_XML_CONFIG_REGEX = "xml:.+";
-
- private static final String FORMAT_JSON_CONFIG_REGEX = "json:.+";
-
- private static final String FORMAT_YML_CONFIG_REGEX = "yml:.+";
-
private static final String PREFIX_FORMAT_CONFIG_REGEX = "xml:|json:|yml:|el_xml:|el_json:|el_yml:";
private static final String CLASS_CONFIG_REGEX = "^(xml:|json:|yml:|el_xml:|el_json:|el_yml:)?\\w+(\\.\\w+)*$";
- private static final String ZK_CONFIG_REGEX = "(xml:|json:|yml:|el_xml:|el_json:|el_yml:)?[\\w\\d][\\w\\d\\.]+\\:(\\d)+(\\,[\\w\\d][\\w\\d\\.]+\\:(\\d)+)*";
-
/**
* 根据配置的地址找到对应的解析器
*/
@@ -118,34 +104,6 @@ public class FlowParserProvider {
String errorMsg = StrUtil.format("can't support the format {}", path);
throw new ErrorSupportPathException(errorMsg);
}
- else if (isZKConfig(path)) {
- FlowParserFactory factory = new ZookeeperParserFactory();
- if (ReUtil.isMatch(FORMAT_XML_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper,zkNode={},format type={}", path, TYPE_XML.getType());
- return factory.createXmlParser(path);
- }
- else if (ReUtil.isMatch(FORMAT_JSON_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper,zkNode={},format type={}", path, TYPE_JSON.getType());
- return factory.createJsonParser(path);
- }
- else if (ReUtil.isMatch(FORMAT_YML_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper,zkNode={},format type={}", path, TYPE_YML.getType());
- return factory.createYmlParser(path);
- }
- else if (ReUtil.isMatch(FORMAT_EL_XML_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper with el,zkNode={},format type={}", path, TYPE_EL_XML.getType());
- return factory.createXmlELParser(path);
- }
- else if (ReUtil.isMatch(FORMAT_EL_YML_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper with el,zkNode={},format type={}", path, TYPE_EL_YML.getType());
- return factory.createYmlELParser(path);
- }
- else if (ReUtil.isMatch(FORMAT_EL_JSON_CONFIG_REGEX, path)) {
- LOG.info("flow info loaded from Zookeeper with el,zkNode={},format type={}", path, TYPE_EL_JSON.getType());
- return factory.createJsonELParser(path);
- }
-
- }
// not found
String errorMsg = StrUtil.format("can't find the parser for path:{}", path);
@@ -170,11 +128,4 @@ public class FlowParserProvider {
private static boolean isClassConfig(String path) {
return ReUtil.isMatch(CLASS_CONFIG_REGEX, path);
}
-
- /**
- * 判定是否为zk配置
- */
- private static boolean isZKConfig(String path) {
- return ReUtil.isMatch(ZK_CONFIG_REGEX, path);
- }
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ZookeeperParserFactory.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ZookeeperParserFactory.java
deleted file mode 100644
index deec5f84d..000000000
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/factory/ZookeeperParserFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.yomahub.liteflow.parser.factory;
-
-import com.yomahub.liteflow.parser.*;
-import com.yomahub.liteflow.parser.base.BaseJsonFlowParser;
-import com.yomahub.liteflow.parser.base.BaseXmlFlowParser;
-import com.yomahub.liteflow.parser.base.BaseYmlFlowParser;
-import com.yomahub.liteflow.parser.el.*;
-import com.yomahub.liteflow.property.LiteflowConfigGetter;
-
-/**
- * Class文件
- *
- *
- * @author junjun
- */
-public class ZookeeperParserFactory implements FlowParserFactory {
-
- @Override
- public BaseJsonFlowParser createJsonParser(String path) {
- return new ZookeeperJsonFlowParser(LiteflowConfigGetter.get().getZkNode());
- }
-
- @Override
- public BaseXmlFlowParser createXmlParser(String path) {
- return new ZookeeperXmlFlowParser(LiteflowConfigGetter.get().getZkNode());
- }
-
- @Override
- public BaseYmlFlowParser createYmlParser(String path) {
- return new ZookeeperYmlFlowParser(LiteflowConfigGetter.get().getZkNode());
- }
-
- @Override
- public BaseJsonFlowParser createJsonELParser(String path) {
- return new ZookeeperJsonFlowELParser(LiteflowConfigGetter.get().getZkNode());
- }
-
- @Override
- public BaseXmlFlowParser createXmlELParser(String path) {
- return new ZookeeperXmlFlowELParser(LiteflowConfigGetter.get().getZkNode());
- }
-
- @Override
- public BaseYmlFlowParser createYmlELParser(String path) {
- return new ZookeeperYmlFlowELParser(LiteflowConfigGetter.get().getZkNode());
- }
-}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/spi/ParserClassNameSpi.java b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/spi/ParserClassNameSpi.java
new file mode 100644
index 000000000..6466ed9bb
--- /dev/null
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/parser/spi/ParserClassNameSpi.java
@@ -0,0 +1,11 @@
+package com.yomahub.liteflow.parser.spi;
+
+/**
+ * 解析器SPI插件接口
+ * @author Bryan.Zhang
+ * @since 2.8.6
+ */
+public interface ParserClassNameSpi {
+
+ String getSpiClassName();
+}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java
index f50d8f46c..671f08b02 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfig.java
@@ -29,8 +29,8 @@ public class LiteflowConfig {
//流程定义资源地址
private String ruleSource;
- //zk配置的node定义
- private String zkNode;
+ //流程资源扩展数据
+ private String ruleSourceExtData;
//slot的数量
private Integer slotSize;
@@ -242,18 +242,6 @@ public class LiteflowConfig {
this.retryCount = retryCount;
}
- public String getZkNode() {
- if (StrUtil.isBlank(zkNode)) {
- return "/lite-flow/flow";
- } else {
- return zkNode;
- }
- }
-
- public void setZkNode(String zkNode) {
- this.zkNode = zkNode;
- }
-
public Boolean getPrintBanner() {
if (ObjectUtil.isNull(printBanner)) {
return Boolean.TRUE;
@@ -344,4 +332,12 @@ public class LiteflowConfig {
public void setSubstituteCmpClass(String substituteCmpClass) {
this.substituteCmpClass = substituteCmpClass;
}
+
+ public String getRuleSourceExtData() {
+ return ruleSourceExtData;
+ }
+
+ public void setRuleSourceExtData(String ruleSourceExtData) {
+ this.ruleSourceExtData = ruleSourceExtData;
+ }
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfigGetter.java b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfigGetter.java
index 04a8098a9..c5951338e 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfigGetter.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/property/LiteflowConfigGetter.java
@@ -16,7 +16,7 @@ public class LiteflowConfigGetter {
//这里liteflowConfig不可能为null
//如果在springboot环境,由于自动装配,所以不可能为null
//在spring环境,如果xml没配置,在FlowExecutor的init时候就已经报错了
- //只有在非spring环境下,是为null
+ //非spring环境下,FlowExecutorHolder.loadInstance(config)的时候,会把config放入这个类的静态属性中
if (ObjectUtil.isNull(liteflowConfig)){
liteflowConfig = new LiteflowConfig();
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/util/JsonUtil.java b/liteflow-core/src/main/java/com/yomahub/liteflow/util/JsonUtil.java
index 2642bc9de..9ca896fcf 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/util/JsonUtil.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/util/JsonUtil.java
@@ -54,4 +54,17 @@ public class JsonUtil {
throw new JsonProcessException(errMsg);
}
}
+
+ public static T parseObject(String json, Class clazz){
+ if (StrUtil.isEmpty(json)) {
+ return null;
+ }
+ try {
+ return objectMapper.readValue(json, clazz);
+ } catch (IOException e) {
+ String errMsg = StrUtil.format("Error while parsing text [{}],reason: {}", json, e.getMessage());
+ LOG.error(e.getMessage(), e);
+ throw new JsonProcessException(errMsg);
+ }
+ }
}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java b/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java
index c7ee90b91..e2cf6fe95 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java
+++ b/liteflow-core/src/main/java/com/yomahub/liteflow/util/LOGOPrinter.java
@@ -13,7 +13,7 @@ public class LOGOPrinter {
/**
* LiteFlow 当前版本号
*/
- private static final String VERSION_NO = "v2.8.6-BETA";
+ private static final String VERSION_NO = "v2.9.0";
public static void print() {
StringBuilder str = new StringBuilder("\n");
diff --git a/liteflow-rule-zk/pom.xml b/liteflow-rule-zk/pom.xml
new file mode 100644
index 000000000..740cfd04d
--- /dev/null
+++ b/liteflow-rule-zk/pom.xml
@@ -0,0 +1,46 @@
+
+
+
+ com.yomahub
+ liteflow
+ ${revision}
+ ../pom.xml
+
+ 4.0.0
+
+ liteflow-rule-zk
+
+
+
+ com.yomahub
+ liteflow-core
+ ${revision}
+ true
+
+
+
+ org.apache.curator
+ curator-framework
+
+
+ log4j
+ log4j
+
+
+ slf4j-api
+ org.slf4j
+
+
+ commons-lang
+ commons-lang
+
+
+
+
+ org.apache.curator
+ curator-recipes
+
+
+
\ No newline at end of file
diff --git a/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/spi/zk/ZkParserClassNameSpi.java b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/spi/zk/ZkParserClassNameSpi.java
new file mode 100644
index 000000000..694ae1c69
--- /dev/null
+++ b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/spi/zk/ZkParserClassNameSpi.java
@@ -0,0 +1,17 @@
+package com.yomahub.liteflow.parser.spi.zk;
+
+
+import com.yomahub.liteflow.parser.spi.ParserClassNameSpi;
+import com.yomahub.liteflow.parser.zk.ZkXmlELParser;
+
+/**
+ * ZK解析器SPI实现
+ * @author Bryan.Zhang
+ * @since 2.8.6
+ */
+public class ZkParserClassNameSpi implements ParserClassNameSpi {
+ @Override
+ public String getSpiClassName() {
+ return ZkXmlELParser.class.getName();
+ }
+}
diff --git a/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/ZkXmlELParser.java b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/ZkXmlELParser.java
new file mode 100644
index 000000000..88e231f76
--- /dev/null
+++ b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/ZkXmlELParser.java
@@ -0,0 +1,69 @@
+package com.yomahub.liteflow.parser.zk;
+
+import cn.hutool.core.util.StrUtil;
+import com.yomahub.liteflow.parser.el.ClassXmlFlowELParser;
+import com.yomahub.liteflow.parser.zk.exception.ZkException;
+import com.yomahub.liteflow.parser.zk.util.ZkParserHelper;
+import com.yomahub.liteflow.parser.zk.vo.ZkParserVO;
+import com.yomahub.liteflow.property.LiteflowConfig;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.util.JsonUtil;
+import org.apache.curator.framework.CuratorFramework;
+
+import java.util.function.Consumer;
+
+/**
+ * ZK解析器实现,只支持EL形式的XML,不支持其他的形式
+ * @author Bryan.Zhang
+ * @since 2.8.6
+ */
+public class ZkXmlELParser extends ClassXmlFlowELParser {
+
+ private final ZkParserHelper zkParserHelper;
+
+ public ZkXmlELParser() {
+ Consumer parseConsumer = t -> {
+ try {
+ parse(t);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ };
+ LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();
+
+ if (StrUtil.isBlank(liteflowConfig.getRuleSourceExtData())){
+ throw new ZkException("rule-source-ext-data is empty");
+ }
+
+ try{
+ ZkParserVO zkParserVO = JsonUtil.parseObject(liteflowConfig.getRuleSourceExtData(), ZkParserVO.class);
+ assert zkParserVO != null;
+
+ if (StrUtil.isBlank(zkParserVO.getNodePath())){
+ zkParserVO.setNodePath("/lite-flow/flow");
+ }
+ if (StrUtil.isBlank(zkParserVO.getConnectStr())){
+ throw new ZkException("zk connect string is empty");
+ }
+
+ zkParserHelper = new ZkParserHelper(zkParserVO, parseConsumer);
+ }catch (Exception e){
+ throw new ZkException(e.getMessage());
+ }
+ }
+
+ @Override
+ public String parseCustom() {
+ try{
+ String content = zkParserHelper.getContent();
+
+ zkParserHelper.checkContent(content);
+
+ zkParserHelper.listenZkNode();
+
+ return content;
+ }catch (Exception e){
+ throw new ZkException(e.getMessage());
+ }
+ }
+}
diff --git a/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/exception/ZkException.java b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/exception/ZkException.java
new file mode 100644
index 000000000..a7b315fe3
--- /dev/null
+++ b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/exception/ZkException.java
@@ -0,0 +1,23 @@
+
+package com.yomahub.liteflow.parser.zk.exception;
+
+public class ZkException extends RuntimeException {
+
+ private static final long serialVersionUID = 1L;
+
+ /** 异常信息 */
+ private String message;
+
+ public ZkException(String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+}
diff --git a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ZkParserHelper.java b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/util/ZkParserHelper.java
similarity index 50%
rename from liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ZkParserHelper.java
rename to liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/util/ZkParserHelper.java
index aa09b4a3b..96b1e476d 100644
--- a/liteflow-core/src/main/java/com/yomahub/liteflow/parser/helper/ZkParserHelper.java
+++ b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/util/ZkParserHelper.java
@@ -1,7 +1,9 @@
-package com.yomahub.liteflow.parser.helper;
+package com.yomahub.liteflow.parser.zk.util;
import cn.hutool.core.util.StrUtil;
import com.yomahub.liteflow.exception.ParseException;
+import com.yomahub.liteflow.parser.zk.exception.ZkException;
+import com.yomahub.liteflow.parser.zk.vo.ZkParserVO;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.framework.recipes.cache.NodeCache;
@@ -10,63 +12,61 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.MessageFormat;
-import java.util.List;
import java.util.function.Consumer;
public class ZkParserHelper {
private static final Logger LOG = LoggerFactory.getLogger(ZkParserHelper.class);
- private final String nodePath;
+ private final ZkParserVO zkParserVO;
private final Consumer parseConsumer;
- public ZkParserHelper(String node, Consumer parseConsumer) {
- this.nodePath = node;
+ private final CuratorFramework client;
+
+ public ZkParserHelper(ZkParserVO zkParserVO, Consumer parseConsumer) {
+ this.zkParserVO = zkParserVO;
this.parseConsumer = parseConsumer;
+
+ try{
+ CuratorFramework client = CuratorFrameworkFactory.newClient(
+ zkParserVO.getConnectStr(),
+ new RetryNTimes(10, 5000)
+ );
+ client.start();
+
+ if (client.checkExists().forPath(zkParserVO.getNodePath()) == null) {
+ client.create().creatingParentsIfNeeded().forPath(zkParserVO.getNodePath(), "".getBytes());
+ }
+ this.client = client;
+ }catch (Exception e){
+ throw new ZkException(e.getMessage());
+ }
+
}
- /**
- * 获取zk客户端
- *
- * @param pathList zk路径
- * @return
- * @throws Exception
- */
- public CuratorFramework getZkCuratorFramework(List pathList) throws Exception {
- //zk不允许有多个path
- String path = pathList.get(0);
- CuratorFramework client = CuratorFrameworkFactory.newClient(
- path,
- new RetryNTimes(10, 5000)
- );
- client.start();
-
- if (client.checkExists().forPath(nodePath) == null) {
- client.create().creatingParentsIfNeeded().forPath(nodePath, "".getBytes());
+ public String getContent(){
+ try{
+ return new String(client.getData().forPath(zkParserVO.getNodePath()));
+ }catch (Exception e){
+ throw new ZkException(e.getMessage());
}
- return client;
}
/**
* 检查 content 是否合法
- *
- * @param content 内容
*/
public void checkContent(String content) {
if (StrUtil.isBlank(content)) {
- String error = MessageFormat.format("the node[{0}] value is empty", nodePath);
+ String error = MessageFormat.format("the node[{0}] value is empty", zkParserVO.getNodePath());
throw new ParseException(error);
}
}
/**
* 监听 zk 节点
- *
- * @param client zk 客户端
- * @throws Exception
*/
- public void listenZkNode(CuratorFramework client) throws Exception {
- final NodeCache cache = new NodeCache(client, nodePath);
+ public void listenZkNode() throws Exception {
+ final NodeCache cache = new NodeCache(client, zkParserVO.getNodePath());
cache.start();
cache.getListenable().addListener(() -> {
diff --git a/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/vo/ZkParserVO.java b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/vo/ZkParserVO.java
new file mode 100644
index 000000000..315797a8b
--- /dev/null
+++ b/liteflow-rule-zk/src/main/java/com/yomahub/liteflow/parser/zk/vo/ZkParserVO.java
@@ -0,0 +1,29 @@
+package com.yomahub.liteflow.parser.zk.vo;
+
+/**
+ * 用于解析RuleSourceExtData的vo类,用于zk模式中
+ * @author Bryan.Zhang
+ * @since 2.8.6
+ */
+public class ZkParserVO {
+
+ private String connectStr;
+
+ private String nodePath;
+
+ public String getConnectStr() {
+ return connectStr;
+ }
+
+ public void setConnectStr(String connectStr) {
+ this.connectStr = connectStr;
+ }
+
+ public String getNodePath() {
+ return nodePath;
+ }
+
+ public void setNodePath(String nodePath) {
+ this.nodePath = nodePath;
+ }
+}
diff --git a/liteflow-rule-zk/src/main/resources/META-INF/services/com.yomahub.liteflow.parser.spi.ParserClassNameSpi b/liteflow-rule-zk/src/main/resources/META-INF/services/com.yomahub.liteflow.parser.spi.ParserClassNameSpi
new file mode 100644
index 000000000..ba7604419
--- /dev/null
+++ b/liteflow-rule-zk/src/main/resources/META-INF/services/com.yomahub.liteflow.parser.spi.ParserClassNameSpi
@@ -0,0 +1 @@
+com.yomahub.liteflow.parser.spi.zk.ZkParserClassNameSpi
\ No newline at end of file
diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java
index 1ad21adcc..884ac5de2 100644
--- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java
+++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/LiteflowProperty.java
@@ -15,8 +15,8 @@ public class LiteflowProperty {
//流程定义资源地址
private String ruleSource;
- //zk配置的node节点地址
- private String zkNode;
+ //流程资源扩展数据
+ private String ruleSourceExtData;
//slot的数量
private int slotSize;
@@ -137,14 +137,6 @@ public class LiteflowProperty {
this.retryCount = retryCount;
}
- public String getZkNode() {
- return zkNode;
- }
-
- public void setZkNode(String zkNode) {
- this.zkNode = zkNode;
- }
-
public boolean isPrintBanner() {
return printBanner;
}
@@ -208,4 +200,12 @@ public class LiteflowProperty {
public void setSubstituteCmpClass(String substituteCmpClass) {
this.substituteCmpClass = substituteCmpClass;
}
+
+ public String getRuleSourceExtData() {
+ return ruleSourceExtData;
+ }
+
+ public void setRuleSourceExtData(String ruleSourceExtData) {
+ this.ruleSourceExtData = ruleSourceExtData;
+ }
}
diff --git a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java
index 80986b4bf..75b568c63 100644
--- a/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java
+++ b/liteflow-spring-boot-starter/src/main/java/com/yomahub/liteflow/springboot/config/LiteflowPropertyAutoConfiguration.java
@@ -25,6 +25,7 @@ public class LiteflowPropertyAutoConfiguration {
public LiteflowConfig liteflowConfig(LiteflowProperty property, LiteflowMonitorProperty liteflowMonitorProperty){
LiteflowConfig liteflowConfig = new LiteflowConfig();
liteflowConfig.setRuleSource(property.getRuleSource());
+ liteflowConfig.setRuleSourceExtData(property.getRuleSourceExtData());
liteflowConfig.setSlotSize(property.getSlotSize());
liteflowConfig.setThreadExecutorClass(property.getThreadExecutorClass());
liteflowConfig.setWhenMaxWaitSeconds(property.getWhenMaxWaitSeconds());
@@ -38,7 +39,6 @@ public class LiteflowPropertyAutoConfiguration {
liteflowConfig.setEnable(property.isEnable());
liteflowConfig.setSupportMultipleType(property.isSupportMultipleType());
liteflowConfig.setRetryCount(property.getRetryCount());
- liteflowConfig.setZkNode(property.getZkNode());
liteflowConfig.setPrintBanner(property.isPrintBanner());
liteflowConfig.setNodeExecutorClass(property.getNodeExecutorClass());
liteflowConfig.setRequestIdGeneratorClass(property.getRequestIdGeneratorClass());
diff --git a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index 51b0a3324..b60dcf563 100644
--- a/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ b/liteflow-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -1,5 +1,11 @@
{
"properties": [
+ {
+ "name": "liteflow.rule-source-ext-data",
+ "type": "java.lang.String",
+ "description": "rule source extended data.",
+ "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty"
+ },
{
"name": "liteflow.request-id-generator-class",
"type": "java.lang.String",
@@ -28,13 +34,6 @@
"sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
"defaultValue": true
},
- {
- "name": "liteflow.zk-node",
- "type": "java.lang.String",
- "description": "Node definition for ZK configuration.",
- "sourceType": "com.yomahub.liteflow.springboot.LiteflowProperty",
- "defaultValue": "/lite-flow/flow"
- },
{
"name": "liteflow.slot-size",
"type": "java.lang.Integer",
diff --git a/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties b/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
index 50264318f..35a41afd5 100644
--- a/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
+++ b/liteflow-spring-boot-starter/src/main/resources/META-INF/liteflow-default.properties
@@ -1,6 +1,5 @@
liteflow.enable=true
liteflow.print-banner=true
-liteflow.zk-node=/lite-flow/flow
liteflow.slot-size=1024
liteflow.main-executor-works=64
liteflow.main-executor-class=com.yomahub.liteflow.thread.LiteFlowDefaultMainExecutorBuilder
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELDeclSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELDeclSpringbootTest.java
deleted file mode 100644
index 9c4081e83..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELDeclSpringbootTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * springboot环境下的zk配置源功能测试
- * ZK节点存储数据的格式为json文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/zookeeper/application-json.properties")
-@SpringBootTest(classes = ZkNodeWithJsonELDeclSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.zookeeper.cmp"})
-public class ZkNodeWithJsonELDeclSpringbootTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.json");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void testZkNodeWithJson() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELDeclSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELDeclSpringbootTest.java
deleted file mode 100644
index d578554ad..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELDeclSpringbootTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * springboot环境下的zk配置源功能测试
- * ZK节点存储数据的格式为xml文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/zookeeper/application-xml.properties")
-@SpringBootTest(classes = ZkNodeWithXmlELDeclSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.zookeeper.cmp"})
-public class ZkNodeWithXmlELDeclSpringbootTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.xml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void testZkNodeWithXml() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELDeclSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELDeclSpringbootTest.java
deleted file mode 100644
index 4776d94ea..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELDeclSpringbootTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * springboot环境下的zk配置源功能测试
- * ZK节点存储数据的格式为yml文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/zookeeper/application-yml.properties")
-@SpringBootTest(classes = ZkNodeWithYmlELDeclSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.zookeeper.cmp"})
-public class ZkNodeWithYmlELDeclSpringbootTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.yml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void testZkNodeWithYml() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
deleted file mode 100644
index 31ae50e37..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-@LiteflowCmpDefine
-public class ACmp{
-
- @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
- public void process(NodeComponent bindCmp) {
- System.out.println("ACmp executed!");
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
deleted file mode 100644
index 0599bc17f..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-@LiteflowCmpDefine
-public class BCmp{
-
- @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
- public void process(NodeComponent bindCmp) {
- System.out.println("BCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
deleted file mode 100644
index cddcc3365..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.annotation.LiteflowCmpDefine;
-import com.yomahub.liteflow.annotation.LiteflowMethod;
-import com.yomahub.liteflow.core.NodeComponent;
-import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-@LiteflowCmpDefine
-public class CCmp{
-
- @LiteflowMethod(LiteFlowMethodEnum.PROCESS)
- public void process(NodeComponent bindCmp) {
- System.out.println("CCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-json.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-json.properties
deleted file mode 100644
index e8d44c429..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_json:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-xml.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-xml.properties
deleted file mode 100644
index e3a6e33db..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_xml:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-yml.properties b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-yml.properties
deleted file mode 100644
index 8022eb56f..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/application-yml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_yml:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.json b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.json
deleted file mode 100644
index e78b1e919..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "flow": {
- "chain": [
- {
- "name": "chain1",
- "value": "THEN(a, b, c);"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.yml b/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.yml
deleted file mode 100644
index 2b7bfd1dc..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-flow:
- chain:
- - name: chain1
- value: "THEN(a, b, c);"
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonTest.java
deleted file mode 100644
index 29e0815cd..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * 非spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为json文件
- * @author zendwang
- * @since 2.5.0
- */
-public class ZkNodeWithJsonTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- private static FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.json");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
-
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("el_json:127.0.0.1:21810");
- flowExecutor = FlowExecutorHolder.loadInstance(config);
- }
-
- @Test
- public void testZkNodeWithJson() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlTest.java
deleted file mode 100644
index 7f8e0569c..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * 非spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为xml文件
- * @author zendwang
- * @since 2.5.0
- */
-public class ZkNodeWithXmlTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- private static FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.xml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
-
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("el_xml:127.0.0.1:21810");
- flowExecutor = FlowExecutorHolder.loadInstance(config);
- }
-
- @Test
- public void testZkNodeWithXml() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlTest.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlTest.java
deleted file mode 100644
index 223c54a5a..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.core.FlowExecutorHolder;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.property.LiteflowConfig;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * 非spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为yml文件
- * @author zendwang
- * @since 2.5.0
- */
-public class ZkNodeWithYmlTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- private static FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.yml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
-
- LiteflowConfig config = new LiteflowConfig();
- config.setRuleSource("el_yml:127.0.0.1:21810");
- flowExecutor = FlowExecutorHolder.loadInstance(config);
- }
-
- @Test
- public void testZkNodeWithYml() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
deleted file mode 100644
index 9201a7b6b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-
-public class ACmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("ACmp executed!");
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
deleted file mode 100644
index da6444f5f..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-
-public class BCmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("BCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
deleted file mode 100644
index a4d7ed06b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-nospring/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-
-public class CCmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("CCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringbootTest.java
deleted file mode 100644
index bdda819be..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringbootTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * springboot环境下的zk配置源功能测试
- * ZK节点存储数据的格式为json文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/zookeeper/application-json.properties")
-@SpringBootTest(classes = ZkNodeWithJsonELSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.zookeeper.cmp"})
-public class ZkNodeWithJsonELSpringbootTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.json");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void testZkNodeWithJson() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringbootTest.java
deleted file mode 100644
index d7c0ee58b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringbootTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.test.context.TestPropertySource;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * springboot环境下的zk配置源功能测试
- * ZK节点存储数据的格式为yml文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@TestPropertySource(value = "classpath:/zookeeper/application-yml.properties")
-@SpringBootTest(classes = ZkNodeWithYmlELSpringbootTest.class)
-@EnableAutoConfiguration
-@ComponentScan({"com.yomahub.liteflow.test.zookeeper.cmp"})
-public class ZkNodeWithYmlELSpringbootTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.yml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void testZkNodeWithYml() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-json.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-json.properties
deleted file mode 100644
index e8d44c429..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-json.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_json:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml-cluster.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml-cluster.properties
deleted file mode 100644
index 5a92f38d8..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml-cluster.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_xml:127.0.0.1:21810,127.0.0.1:21811,127.0.0.1:21812
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml.properties
deleted file mode 100644
index e3a6e33db..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-xml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_xml:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-yml.properties b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-yml.properties
deleted file mode 100644
index 8022eb56f..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/application-yml.properties
+++ /dev/null
@@ -1 +0,0 @@
-liteflow.rule-source=el_yml:127.0.0.1:21810
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.json b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.json
deleted file mode 100644
index e78b1e919..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "flow": {
- "chain": [
- {
- "name": "chain1",
- "value": "THEN(a, b, c);"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.xml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.xml
deleted file mode 100644
index 049210cf4..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- THEN(a, b, c);
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.yml b/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.yml
deleted file mode 100644
index 2b7bfd1dc..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/resources/zookeeper/flow.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-flow:
- chain:
- - name: chain1
- value: "THEN(a, b, c);"
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringTest.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringTest.java
deleted file mode 100644
index 67ffd1646..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithJsonELSpringTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为json文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@ContextConfiguration("classpath:/zookeeper/application-json.xml")
-public class ZkNodeWithJsonELSpringTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.el.json");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void test() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- Assert.assertEquals("a==>b==>c", response.getExecuteStepStr());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringTest.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringTest.java
deleted file mode 100644
index 82fb82ceb..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为xml文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@ContextConfiguration("classpath:/zookeeper/application-xml.xml")
-public class ZkNodeWithXmlELSpringTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.el.xml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void test() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- Assert.assertEquals("a==>b==>c", response.getExecuteStepStr());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringTest.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringTest.java
deleted file mode 100644
index 2cdfcb493..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithYmlELSpringTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.yomahub.liteflow.test.zookeeper;
-
-import cn.hutool.core.io.resource.ResourceUtil;
-import com.yomahub.liteflow.core.FlowExecutor;
-import com.yomahub.liteflow.flow.LiteflowResponse;
-import com.yomahub.liteflow.test.BaseTest;
-import org.I0Itec.zkclient.ZkClient;
-import org.I0Itec.zkclient.exception.ZkMarshallingError;
-import org.I0Itec.zkclient.serialize.ZkSerializer;
-import org.apache.curator.test.TestingServer;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringRunner;
-
-import javax.annotation.Resource;
-import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * spring环境下的zk配置源功能测试
- * ZK节点存储数据的格式为yml文件
- * @author zendwang
- * @since 2.5.0
- */
-@RunWith(SpringRunner.class)
-@ContextConfiguration("classpath:/zookeeper/application-yml.xml")
-public class ZkNodeWithYmlELSpringTest extends BaseTest {
-
- private static final String ZK_NODE_PATH = "/lite-flow/flow";
-
- private static TestingServer zkServer;
-
- @Resource
- private FlowExecutor flowExecutor;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- zkServer = new TestingServer(21810);
- CountDownLatch latch = new CountDownLatch(1);
- new Thread(() -> {
- String data = ResourceUtil.readUtf8Str("zookeeper/flow.el.yml");
- ZkClient zkClient = new ZkClient("127.0.0.1:21810");
- zkClient.setZkSerializer(new ZkSerializer() {
- @Override
- public byte[] serialize(final Object o) throws ZkMarshallingError {
- return o.toString().getBytes(Charset.forName("UTF-8"));
- }
-
- @Override
- public Object deserialize(final byte[] bytes) throws ZkMarshallingError {
- return new String(bytes, Charset.forName("UTF-8"));
- }
- });
- zkClient.createPersistent(ZK_NODE_PATH, true);
- zkClient.writeData(ZK_NODE_PATH, data);
- zkClient.close();
- latch.countDown();
- }).start();
- latch.await();
- }
-
- @Test
- public void test() {
- LiteflowResponse response = flowExecutor.execute2Resp("chain1", "arg");
- Assert.assertTrue(response.isSuccess());
- Assert.assertEquals("a==>b==>c", response.getExecuteStepStr());
- }
-
- @AfterClass
- public static void tearDown() throws Exception {
- zkServer.stop();
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
deleted file mode 100644
index f4fcf186d..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-import org.springframework.stereotype.Component;
-
-@Component("a")
-public class ACmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("ACmp executed!");
- }
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
deleted file mode 100644
index e621cd1a0..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-import org.springframework.stereotype.Component;
-
-@Component("b")
-public class BCmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("BCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
deleted file mode 100644
index f428f348b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * Title: liteflow
- * Description: 轻量级的组件式流程框架
- * @author Bryan.Zhang
- * @email weenyc31@163.com
- * @Date 2020/4/1
- */
-package com.yomahub.liteflow.test.zookeeper.cmp;
-
-import com.yomahub.liteflow.core.NodeComponent;
-import org.springframework.stereotype.Component;
-
-@Component("c")
-public class CCmp extends NodeComponent {
-
- @Override
- public void process() {
- System.out.println("CCmp executed!");
- }
-
-}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-json.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-json.xml
deleted file mode 100644
index 1a52574a8..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-json.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-xml.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-xml.xml
deleted file mode 100644
index 0f52fdc9b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-xml.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-yml.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-yml.xml
deleted file mode 100644
index 05bb76d31..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/application-yml.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.json b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.json
deleted file mode 100644
index f4ffa60ea..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "flow": {
- "chain": [
- {
- "name": "chain1",
- "value": "THEN(a,b,c)"
- }
- ]
- }
-}
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.xml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.xml
deleted file mode 100644
index 0204879f9..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
- THEN(a,b,c)
-
-
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.yml b/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.yml
deleted file mode 100644
index f5bf8e28b..000000000
--- a/liteflow-testcase-el/liteflow-testcase-el-springnative/src/test/resources/zookeeper/flow.el.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-flow:
- chain:
- - name: chain1
- value: "THEN(a,b,c)"
-
diff --git a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/pom.xml b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/pom.xml
new file mode 100644
index 000000000..184f08915
--- /dev/null
+++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/pom.xml
@@ -0,0 +1,67 @@
+
+
+
+ liteflow-testcase-el
+ com.yomahub
+ ${revision}
+ ../pom.xml
+
+ 4.0.0
+
+ liteflow-testcase-el-zk-springboot
+
+
+
+ com.yomahub
+ liteflow-spring-boot-starter
+ ${revision}
+
+
+
+ com.yomahub
+ liteflow-rule-zk
+ ${revision}
+ test
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+
+
+ org.aspectj
+ aspectjweaver
+ test
+
+
+ org.apache.curator
+ curator-test
+ test
+
+
+ com.101tec
+ zkclient
+ test
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ ${springboot.version}
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ 2.8.2
+
+ true
+
+
+
+
+
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
new file mode 100644
index 000000000..64886670f
--- /dev/null
+++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/BaseTest.java
@@ -0,0 +1,20 @@
+package com.yomahub.liteflow.test;
+
+import com.yomahub.liteflow.flow.FlowBus;
+import com.yomahub.liteflow.property.LiteflowConfigGetter;
+import com.yomahub.liteflow.spi.holder.SpiFactoryCleaner;
+import com.yomahub.liteflow.spring.ComponentScanner;
+import com.yomahub.liteflow.thread.ExecutorHelper;
+import org.junit.AfterClass;
+
+public class BaseTest {
+
+ @AfterClass
+ public static void cleanScanCache(){
+ ComponentScanner.cleanCache();
+ FlowBus.cleanCache();
+ ExecutorHelper.loadInstance().clearExecutorServiceMap();
+ SpiFactoryCleaner.clean();
+ LiteflowConfigGetter.clean();
+ }
+}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java
similarity index 96%
rename from liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java
index 52f9e8ce3..9d5ba3d86 100644
--- a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java
+++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkClusterWithXmlELSpringbootTest.java
@@ -9,7 +9,6 @@ import org.I0Itec.zkclient.exception.ZkMarshallingError;
import org.I0Itec.zkclient.serialize.ZkSerializer;
import org.apache.curator.test.InstanceSpec;
import org.apache.curator.test.TestingCluster;
-import org.apache.curator.test.TestingServer;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
@@ -23,7 +22,6 @@ import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.nio.charset.Charset;
-import java.util.concurrent.CountDownLatch;
/**
* springboot环境下的zk cluster的测试
@@ -73,7 +71,7 @@ public class ZkClusterWithXmlELSpringbootTest extends BaseTest {
Assert.assertTrue(response.isSuccess());
}
-// @AfterClass
+ @AfterClass
public static void tearDown() throws Exception {
zkCluster.stop();
}
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringbootTest.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringbootTest.java
similarity index 100%
rename from liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringbootTest.java
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/ZkNodeWithXmlELSpringbootTest.java
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
similarity index 100%
rename from liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/ACmp.java
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
similarity index 100%
rename from liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/BCmp.java
diff --git a/liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
similarity index 100%
rename from liteflow-testcase-el/liteflow-testcase-el-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/java/com/yomahub/liteflow/test/zookeeper/cmp/CCmp.java
diff --git a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml-cluster.properties b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml-cluster.properties
new file mode 100644
index 000000000..377abc1ac
--- /dev/null
+++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml-cluster.properties
@@ -0,0 +1 @@
+liteflow.rule-source-ext-data={"connectStr":"127.0.0.1:21810,127.0.0.1:21811,127.0.0.1:21812"}
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml.properties b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml.properties
new file mode 100644
index 000000000..a1ca68fd0
--- /dev/null
+++ b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/application-xml.properties
@@ -0,0 +1 @@
+liteflow.rule-source-ext-data={"connectStr":"127.0.0.1:21810"}
\ No newline at end of file
diff --git a/liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.xml b/liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/flow.xml
similarity index 100%
rename from liteflow-testcase-el/liteflow-testcase-el-declare-springboot/src/test/resources/zookeeper/flow.xml
rename to liteflow-testcase-el/liteflow-testcase-el-zk-springboot/src/test/resources/zookeeper/flow.xml
diff --git a/liteflow-testcase-el/pom.xml b/liteflow-testcase-el/pom.xml
index 5574f1226..ad5434740 100644
--- a/liteflow-testcase-el/pom.xml
+++ b/liteflow-testcase-el/pom.xml
@@ -21,5 +21,6 @@
liteflow-testcase-el-declare-springboot
liteflow-testcase-el-script-groovy-springboot
liteflow-testcase-el-script-qlexpress-springboot
+ liteflow-testcase-el-zk-springboot
\ No newline at end of file
diff --git a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml b/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml
index cdc8b4bbe..709b54ff6 100644
--- a/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml
+++ b/liteflow-testcase-old/liteflow-testcase-declare-springboot/pom.xml
@@ -29,24 +29,6 @@
aspectjweaver
test