Change the naming of thread pool adaptation parameters

pull/235/head
chen.ma 2 years ago
parent 1b7e1c8e97
commit fa5075a7e9

@ -36,12 +36,12 @@ public class ThreadPoolAdapterParameter {
private String threadPoolKey;
/**
* Core size
* Core pool size
*/
private Integer coreSize;
private Integer corePoolSize;
/**
* Maximum size
* Maximum pool size
*/
private Integer maximumSize;
private Integer maximumPoolSize;
}

@ -77,8 +77,8 @@ public class DubboThreadPoolAdapter implements ThreadPoolAdapter, ApplicationLis
if (tp == null) {
return false;
}
tp.setCorePoolSize(threadPoolAdapterParameter.getCoreSize());
tp.setMaximumPoolSize(threadPoolAdapterParameter.getMaximumSize());
tp.setCorePoolSize(threadPoolAdapterParameter.getCorePoolSize());
tp.setMaximumPoolSize(threadPoolAdapterParameter.getMaximumPoolSize());
return true;
}

@ -87,8 +87,8 @@ public class SpringCloudStreamRocketMQThreadPoolAdapter implements ThreadPoolAda
if (rocketMQConsumeExecutor != null) {
int originalCoreSize = rocketMQConsumeExecutor.getCorePoolSize();
int originalMaximumPoolSize = rocketMQConsumeExecutor.getMaximumPoolSize();
rocketMQConsumeExecutor.setCorePoolSize(threadPoolAdapterParameter.getCoreSize());
rocketMQConsumeExecutor.setMaximumPoolSize(threadPoolAdapterParameter.getMaximumSize());
rocketMQConsumeExecutor.setCorePoolSize(threadPoolAdapterParameter.getCorePoolSize());
rocketMQConsumeExecutor.setMaximumPoolSize(threadPoolAdapterParameter.getMaximumPoolSize());
log.info("[{}] RocketMQ consumption thread pool parameter change. coreSize :: {}, maximumSize :: {}",
threadPoolKey,
String.format(CHANGE_DELIMITER, originalCoreSize, rocketMQConsumeExecutor.getCorePoolSize()),

@ -67,7 +67,7 @@ public class ThreadPoolAdapterController {
@PostMapping("/adapter/thread-pool/update")
public Result<Void> updateAdapterThreadPool(@RequestBody ThreadPoolAdapterParameter requestParameter) {
log.info("[{}] Change third-party thread pool data. key: {}, coreSize: {}, maximumSize: {}",
requestParameter.getMark(), requestParameter.getThreadPoolKey(), requestParameter.getCoreSize(), requestParameter.getMaximumSize());
requestParameter.getMark(), requestParameter.getThreadPoolKey(), requestParameter.getCorePoolSize(), requestParameter.getMaximumPoolSize());
ThreadPoolAdapter threadPoolAdapter = THREAD_POOL_ADAPTER_BEAN_CONTAINER.get(requestParameter.getMark());
Optional.ofNullable(threadPoolAdapter).ifPresent(each -> each.updateThreadPool(requestParameter));
return Results.success();

Loading…
Cancel
Save