diff --git a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java index 5b4b3f9e..4f05f7dc 100644 --- a/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java +++ b/hippo4j-config/src/main/java/cn/hippo4j/config/service/biz/impl/ConfigServiceImpl.java @@ -17,10 +17,15 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; +import com.google.common.collect.Lists; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.concurrent.LinkedTransferQueue; +import java.util.concurrent.SynchronousQueue; + /** * Config service impl. * @@ -100,6 +105,7 @@ public class ConfigServiceImpl implements ConfigService { .eq(ConfigAllInfo::getTenantId, config.getTenantId()); config.setGmtCreate(null); + config.setCapacity(getQueueCapacityByType(config)); config.setContent(ContentUtil.getPoolContent(config)); config.setMd5(Md5Util.getTpContentMd5(config)); @@ -111,4 +117,17 @@ public class ConfigServiceImpl implements ConfigService { } } + /** + * 根据队列类型获取队列大小. + *
+ * 不支持设置队列大小 {@link SynchronousQueue} {@link LinkedTransferQueue}
+ *
+ * @param config
+ * @return
+ */
+ private Integer getQueueCapacityByType(ConfigAllInfo config) {
+ List