mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-15 04:22:09 +08:00
enhancement #I2NXDL slot 并发度控制数可以交由业务系统配置
This commit is contained in:
@@ -2,6 +2,7 @@ package com.yomahub.liteflow.springboot;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.yomahub.liteflow.core.FlowExecutor;
|
||||
import com.yomahub.liteflow.entity.data.DataBus;
|
||||
import com.yomahub.liteflow.monitor.MonitorBus;
|
||||
import com.yomahub.liteflow.spring.ComponentScaner;
|
||||
import com.yomahub.liteflow.util.SpringAware;
|
||||
@@ -10,6 +11,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
@@ -17,6 +19,9 @@ import java.util.List;
|
||||
@Configuration
|
||||
@EnableConfigurationProperties({LiteflowProperty.class,LiteflowMonitorProperty.class})
|
||||
@ConditionalOnProperty(prefix = "liteflow", name = "rule-source")
|
||||
@PropertySource(
|
||||
name = "liteflow Default Properties",
|
||||
value = "classpath:/META-INF/liteflow-default.properties")
|
||||
public class LiteflowAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -30,6 +35,9 @@ public class LiteflowAutoConfiguration {
|
||||
List<String> ruleList = Lists.newArrayList(property.getRuleSource().split(","));
|
||||
FlowExecutor flowExecutor = new FlowExecutor();
|
||||
flowExecutor.setRulePath(ruleList);
|
||||
|
||||
DataBus.setSlotSize(property.getSlotSize());
|
||||
|
||||
return flowExecutor;
|
||||
}else{
|
||||
return null;
|
||||
|
||||
@@ -5,13 +5,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "liteflow.monitor", ignoreUnknownFields = true)
|
||||
public class LiteflowMonitorProperty {
|
||||
|
||||
private boolean enableLog = false;
|
||||
private boolean enableLog;
|
||||
|
||||
private int queueLimit = 200;
|
||||
private int queueLimit;
|
||||
|
||||
private long delay = 5*60*1000;
|
||||
private long delay;
|
||||
|
||||
private long period = 5*60*1000;
|
||||
private long period;
|
||||
|
||||
public boolean isEnableLog() {
|
||||
return enableLog;
|
||||
|
||||
@@ -7,6 +7,8 @@ public class LiteflowProperty {
|
||||
|
||||
private String ruleSource;
|
||||
|
||||
private int slotSize;
|
||||
|
||||
public String getRuleSource() {
|
||||
return ruleSource;
|
||||
}
|
||||
@@ -14,4 +16,12 @@ public class LiteflowProperty {
|
||||
public void setRuleSource(String ruleSource) {
|
||||
this.ruleSource = ruleSource;
|
||||
}
|
||||
|
||||
public int getSlotSize() {
|
||||
return slotSize;
|
||||
}
|
||||
|
||||
public void setSlotSize(int slotSize) {
|
||||
this.slotSize = slotSize;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user