Commit 1e7fac18 authored by 杨锐's avatar 杨锐

log

parent 1c7e8460
package cn.quantgroup.tech.brave.service.impl;
import cn.quantgroup.tech.brave.service.ITechExecutorServiceBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ExecutorService;
......@@ -12,13 +13,17 @@ import java.util.concurrent.RejectedExecutionHandler;
*
* @author: yangrui
*/
public class ITechExecutorServiceBuilderNoTrace implements ITechExecutorServiceBuilder {
@Slf4j
public class TechExecutorServiceBuilderNoTrace implements ITechExecutorServiceBuilder {
@Override
public ExecutorService buildExecutorService(int corePoolSize,
int maxPoolSize,
int queueCapacity,
String threadNamePrefix,
RejectedExecutionHandler rejectedExecutionHandler) {
log.info("构建TechExecutorServiceBuilderNoTrace, corePoolSize = 【{}】, maxPoolSize = 【{}】, queueCapacity = 【{}】, " +
"threadNamePrefix = 【{}】, rejectedExecutionHandler = 【{}】", corePoolSize, maxPoolSize, queueCapacity,
threadNamePrefix, rejectedExecutionHandler);
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(corePoolSize);
executor.setMaxPoolSize(maxPoolSize);
......
......@@ -3,6 +3,7 @@ package cn.quantgroup.tech.brave.service.impl;
import brave.propagation.CurrentTraceContext;
import cn.quantgroup.tech.brave.service.ITechExecutorServiceBuilder;
import cn.quantgroup.tech.brave.slf4j.MDCCurrentTraceContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ExecutorService;
......@@ -14,13 +15,17 @@ import java.util.concurrent.RejectedExecutionHandler;
*
* @author: yangrui
*/
public class ITechExecutorServiceBuilderTrace implements ITechExecutorServiceBuilder {
@Slf4j
public class TechExecutorServiceBuilderTrace implements ITechExecutorServiceBuilder {
@Override
public ExecutorService buildExecutorService(int corePoolSize,
int maxPoolSize,
int queueCapacity,
String threadNamePrefix,
RejectedExecutionHandler rejectedExecutionHandler) {
log.info("构建TechExecutorServiceBuilderTrace, corePoolSize = 【{}】, maxPoolSize = 【{}】, queueCapacity = 【{}】, " +
"threadNamePrefix = 【{}】, rejectedExecutionHandler = 【{}】", corePoolSize, maxPoolSize, queueCapacity,
threadNamePrefix, rejectedExecutionHandler);
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(corePoolSize);
executor.setMaxPoolSize(maxPoolSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment