diff --git a/pom.xml b/pom.xml
index a797664c417ef7deb03e048155335e3e6cb55576..d00c7e6fe0e6932a53642723664a1ff476360f25 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.dromara.warm
warm-flow
- 1.8.4
+ 1.8.5-SNAPSHOT
pom
warm-flow
@@ -96,6 +96,9 @@
4.13.2
1.7.36
+
+
+ 3.3.2
@@ -340,9 +343,32 @@
warm-flow-plugin-ui-solon-web
${warm-flow}
+
+
+
+ org.apache.dubbo
+ dubbo-bom
+ ${dubbo.version}
+ pom
+ import
+
+
+
+
+ sdwks
+ sdwks-releases
+ https://lib.sdwks.com/repository/maven-releases/
+
+
+ sdwks
+ sdwks-snapshots
+ https://lib.sdwks.com/repository/maven-snapshots/
+
+
+
diff --git a/warm-flow-core/pom.xml b/warm-flow-core/pom.xml
index 94019985bed6f77a2d2e81347b14854188e265ac..98cc94c672104fad904f783431a5591f5e2a6449 100644
--- a/warm-flow-core/pom.xml
+++ b/warm-flow-core/pom.xml
@@ -6,7 +6,7 @@
org.dromara.warm
warm-flow
- 1.8.4
+ 1.8.5-SNAPSHOT
warm-flow-core
@@ -30,5 +30,10 @@
lombok
provided
+
+
+ org.apache.dubbo
+ dubbo
+
diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java
new file mode 100644
index 0000000000000000000000000000000000000000..3413335fb98e8625bc2cc519bde80c3a88a438d7
--- /dev/null
+++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/config/DubboProperties.java
@@ -0,0 +1,55 @@
+package org.dromara.warm.flow.core.config;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import org.apache.dubbo.config.ApplicationConfig;
+import org.apache.dubbo.config.ConsumerConfig;
+import org.apache.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.config.RegistryConfig;
+
+import java.io.Serializable;
+
+/**
+ * @author monster
+ * @version 1.0
+ * @description: dubbo 配置
+ * @date 2026/2/11 10:35
+ */
+@ToString
+@Getter
+@Setter
+public class DubboProperties implements Serializable {
+ /**
+ * dubbo application
+ */
+ private ApplicationConfig application = new ApplicationConfig();
+
+ /**
+ * dubbo registry
+ */
+ private RegistryConfig registry = new RegistryConfig();
+
+ /**
+ * dubbo protocol
+ */
+ private ProtocolConfig protocol = new ProtocolConfig();
+
+ /**
+ * dubbo consumer
+ */
+ private ConsumerConfig consumer = new ConsumerConfig();
+
+ /**
+ * 接口版本号
+ */
+ private String version;
+
+ /**
+ * dubbo 调用超时时间
+ */
+ private Integer timeout;
+
+ public DubboProperties() {
+ }
+}
diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java
index 9275e8a64711bfd55679ed8e3907896dcfcde218..e494d5e1cc66b8dc01915d45ca151a7f43374488 100644
--- a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java
+++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/entity/Instance.java
@@ -17,6 +17,7 @@ package org.dromara.warm.flow.core.entity;
import org.dromara.warm.flow.core.FlowEngine;
+import java.util.Collections;
import java.util.Date;
import java.util.Map;
diff --git a/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..22a07dd48ac06b489a23aef9d4d4a3c252c12783
--- /dev/null
+++ b/warm-flow-core/src/main/java/org/dromara/warm/flow/core/handler/DubboGenericHandler.java
@@ -0,0 +1,96 @@
+package org.dromara.warm.flow.core.handler;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.ReferenceConfig;
+import org.apache.dubbo.config.bootstrap.builders.ReferenceBuilder;
+import org.apache.dubbo.rpc.service.GenericService;
+import org.dromara.warm.flow.core.config.DubboProperties;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author monster
+ * @version 1.0
+ * @description: dubbo 泛化调用handler
+ * @date 2026/2/11 10:19
+ */
+@Slf4j
+public class DubboGenericHandler {
+ private static final Map> referenceCache = new ConcurrentHashMap<>();
+
+ private DubboProperties dubboProperties;
+
+ public DubboGenericHandler(DubboProperties dubboProperties) {
+ this.dubboProperties = dubboProperties;
+ }
+
+ /**
+ * 获取或创建 ReferenceConfig
+ *
+ * @param interfaceName 接口名
+ * @return ReferenceConfig 实例
+ */
+ private ReferenceConfig getOrCreateReference(String interfaceName) {
+ return referenceCache.computeIfAbsent(interfaceName, key -> {
+ log.info("Creating new ReferenceConfig for interface: {}", key);
+ ReferenceConfig config = ReferenceBuilder.newBuilder()
+ .application(dubboProperties.getApplication())
+ .consumer(dubboProperties.getConsumer())
+ .addRegistry(dubboProperties.getRegistry())
+ .version(dubboProperties.getVersion())
+ .timeout(60 * 1000)
+ .interfaceName(interfaceName)
+ .generic(Boolean.TRUE)
+ .build();
+ return config; // 放入缓存
+ });
+ }
+
+ /**
+ * Spring 容器销毁该 Bean 前,清理所有缓存的 ReferenceConfig
+ */
+ public void destroyAllReferences() {
+ log.info("Shutting down DubboGenericHandler and destroying all cached references.");
+ referenceCache.values().forEach(config -> {
+ try {
+ config.destroy(); // 销毁每个 ReferenceConfig,释放资源
+ log.debug("Destroyed reference for interface: {}", config.getInterface());
+ } catch (Exception e) {
+ log.warn("Error destroying reference for interface: {}", config.getInterface(), e);
+ }
+ });
+ referenceCache.clear();
+ }
+
+ /**
+ * 执行泛化调用
+ *
+ * @param interfaceName 接口全限定名,例如 "org.sdwks.com.facade.UserReadFacade"
+ * @param methodName 要调用的方法名
+ * @param parameterTypes 参数类型数组
+ * @param args 参数值数组
+ * @return 调用结果
+ */
+ public Object invoke(String interfaceName, String methodName, List parameterTypes, List