6 changed files with 122 additions and 1 deletions
@ -0,0 +1,27 @@ |
|||||||
|
/** |
||||||
|
* @author JOJO |
||||||
|
* @class ThreadConfig |
||||||
|
* @date 2023/3/6 |
||||||
|
* @apiNote |
||||||
|
*/ |
||||||
|
|
||||||
|
package co.depsystem.application2.config.thread; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
@Data |
||||||
|
@Component |
||||||
|
@ConfigurationProperties("task.pool") |
||||||
|
public class ThreadConfig { |
||||||
|
|
||||||
|
private int corePoolSize; |
||||||
|
|
||||||
|
private int maxPoolSize; |
||||||
|
|
||||||
|
private int keepAliveSeconds; |
||||||
|
|
||||||
|
private int queueCapacity; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
/** |
||||||
|
* @author JOJO |
||||||
|
* @class ThreadExecutorUtil |
||||||
|
* @date 2023/3/6 |
||||||
|
* @apiNote |
||||||
|
*/ |
||||||
|
|
||||||
|
package co.depsystem.application2.config.thread; |
||||||
|
|
||||||
|
public class ThreadExecutorUtil { |
||||||
|
public static ThreadExecutorUtil start() { |
||||||
|
ThreadConfig threadConfig = SpringContextHolder.getBean(AsynsThread.class) |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
{ |
||||||
|
"properties": [ |
||||||
|
{ |
||||||
|
"name": "task.pool.core-pool-size", |
||||||
|
"type": "java.lang.String", |
||||||
|
"description": "Description for task.pool.core-pool-size." |
||||||
|
} |
||||||
|
] } |
||||||
Loading…
Reference in new issue