feat - 调整debug消费组创建逻辑

This commit is contained in:
wangli 2025-10-23 14:45:31 +08:00
parent 571a1771f1
commit 75b3292de8
2 changed files with 24 additions and 0 deletions

View File

@ -41,6 +41,10 @@ public class WorkflowEngineStarterProperties {
*/ */
private Boolean joinContainerGroup = false; private Boolean joinContainerGroup = false;
/**
* 是否创建本地调试专用的 GID 消费组
*/
private Boolean createDebugGroup = false;
/** /**
* <h3>该参数只针对<strong color=orange></strong>容器环境生效</h3> * <h3>该参数只针对<strong color=orange></strong>容器环境生效</h3>
* 配合 joinContainerGroup 使用且只在 joinContainerGroup = false 时生效 * 配合 joinContainerGroup 使用且只在 joinContainerGroup = false 时生效
@ -116,6 +120,14 @@ public class WorkflowEngineStarterProperties {
this.joinContainerGroup = joinContainerGroup; this.joinContainerGroup = joinContainerGroup;
} }
public Boolean getCreateDebugGroup() {
return createDebugGroup;
}
public void setCreateDebugGroup(Boolean createDebugGroup) {
this.createDebugGroup = createDebugGroup;
}
public String getSpecialId() { public String getSpecialId() {
return specialId; return specialId;
} }

View File

@ -44,6 +44,18 @@ public class NonContainerEnvironmentCondition implements Condition {
return true; return true;
} }
Boolean createDebugGroup = environment.getProperty("workflow.engine.starter.create-debug-group", Boolean.class);
if (Objects.isNull(createDebugGroup)) {
// 获取是否创建调试专用消费组
createDebugGroup = new WorkflowEngineStarterProperties().getCreateDebugGroup();
}
if (log.isDebugEnabled()) {
log.debug("workflow engine starter create-debug-group status: {} ", createDebugGroup);
}
if (!createDebugGroup) {
return false;
}
// 优先外部化配置 // 优先外部化配置
Boolean joinContainerGroup = environment.getProperty("workflow.engine.starter.join-container-group", Boolean.class); Boolean joinContainerGroup = environment.getProperty("workflow.engine.starter.join-container-group", Boolean.class);
if (Objects.isNull(joinContainerGroup)) { if (Objects.isNull(joinContainerGroup)) {