Merge remote-tracking branch 'origin/develop' into develop

1.5.0
chen.ma 2 years ago
commit ebc6dbd72b

@ -25,6 +25,7 @@ import org.springframework.beans.factory.InitializingBean;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static cn.hippo4j.common.constant.Constants.IDENTIFY_SLICER_SYMBOL; import static cn.hippo4j.common.constant.Constants.IDENTIFY_SLICER_SYMBOL;
@ -55,10 +56,13 @@ public class DynamicThreadPoolAdapterRegister implements InitializingBean {
} }
public void discoverAdapterExecutor() { public void discoverAdapterExecutor() {
List<AdapterExecutorProperties> adapterExecutors = bootstrapConfigProperties.getAdapterExecutors(); Optional<List<AdapterExecutorProperties>> adapterExecutorProperties =
for (AdapterExecutorProperties each : adapterExecutors) { Optional.ofNullable(bootstrapConfigProperties.getAdapterExecutors());
adapterExecutorProperties.ifPresent(props -> {
for (AdapterExecutorProperties each : props) {
String buildKey = each.getMark() + IDENTIFY_SLICER_SYMBOL + each.getThreadPoolKey(); String buildKey = each.getMark() + IDENTIFY_SLICER_SYMBOL + each.getThreadPoolKey();
ADAPTER_EXECUTORS_MAP.putIfAbsent(buildKey, each); ADAPTER_EXECUTORS_MAP.putIfAbsent(buildKey, each);
} }
});
} }
} }

Loading…
Cancel
Save