动态线程池-引入
This commit is contained in:
@@ -39,15 +39,13 @@ import org.springframework.scheduling.TaskScheduler;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.*;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
||||||
import java.util.concurrent.Executor;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -70,8 +68,8 @@ public class MyApiService {
|
|||||||
private ActValentineCpService actValentineCpService;
|
private ActValentineCpService actValentineCpService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HeadwearService headwearService;
|
private HeadwearService headwearService;
|
||||||
@Autowired
|
@Resource(name = "bizExecutor")
|
||||||
private Executor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskScheduler taskScheduler;
|
private TaskScheduler taskScheduler;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@@ -28,6 +28,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -42,7 +43,7 @@ public class SkillCardAuidoAdminService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SendSysMsgService sendSysMsgService;
|
private SendSysMsgService sendSysMsgService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 声音秀审核通过 {时间} {通过内容}
|
* 声音秀审核通过 {时间} {通过内容}
|
||||||
|
@@ -48,6 +48,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,7 +83,7 @@ public class DynamicDataAdminService extends BaseService {
|
|||||||
private CommunityDynamicTopicMapMapper communityDynamicTopicMapMapper;
|
private CommunityDynamicTopicMapMapper communityDynamicTopicMapMapper;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
public HSSFWorkbook buildPushRecordExcel(List<Dynamic> dynamics) {
|
public HSSFWorkbook buildPushRecordExcel(List<Dynamic> dynamics) {
|
||||||
List<DynamicVerifyVo> dynamicVerifyVos = dynamics.stream().map(dynamic -> dynamicVerifyAdminService.convertVo(dynamic)).collect(Collectors.toList());
|
List<DynamicVerifyVo> dynamicVerifyVos = dynamics.stream().map(dynamic -> dynamicVerifyAdminService.convertVo(dynamic)).collect(Collectors.toList());
|
||||||
|
@@ -44,6 +44,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,7 +74,7 @@ public class DynamicVerifyAdminService extends BaseService {
|
|||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DynamicSquareService dynamicSquareService;
|
private DynamicSquareService dynamicSquareService;
|
||||||
|
@@ -41,6 +41,7 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by PaperCut on 2018/1/20.
|
* Created by PaperCut on 2018/1/20.
|
||||||
@@ -54,7 +55,7 @@ public class AppVersionAdminController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private QinniuService qiuniuService;
|
private QinniuService qiuniuService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AdminUserService adminUserService;
|
private AdminUserService adminUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
jpa:
|
jpa:
|
||||||
show-sql: true
|
show-sql: true
|
||||||
---
|
---
|
||||||
@@ -36,5 +36,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: prod
|
profiles: prod
|
||||||
@@ -34,5 +34,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
@@ -1,131 +1,65 @@
|
|||||||
package com.accompany.business.config;
|
package com.accompany.business.config;
|
||||||
|
|
||||||
import com.accompany.common.constant.Constant;
|
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
|
||||||
import com.accompany.common.utils.StringUtils;
|
import cn.hippo4j.core.executor.DynamicThreadPool;
|
||||||
|
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
|
||||||
|
import cn.hippo4j.core.toolkit.ExecutorTraceContextUtil;
|
||||||
|
import com.accompany.common.utils.UUIDUitl;
|
||||||
|
import com.accompany.core.util.StringUtils;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.slf4j.MDC;
|
|
||||||
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
|
import org.springframework.aop.interceptor.AsyncExecutionAspectSupport;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.core.task.TaskDecorator;
|
||||||
import org.springframework.scheduling.annotation.EnableAsync;
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
||||||
import org.springframework.util.concurrent.ListenableFuture;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.*;
|
|
||||||
|
|
||||||
|
@EnableDynamicThreadPool
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ExecutorConfig {
|
public class ExecutorConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public Executor bizExecutor() {
|
@Primary
|
||||||
ThreadPoolTaskExecutor executor = newThreadPoolTaskExecutor();
|
@DynamicThreadPool
|
||||||
//配置核心线程数
|
public ThreadPoolExecutor bizExecutor() {
|
||||||
executor.setCorePoolSize(10);
|
String threadPoolId = "biz-executor";
|
||||||
//配置最大线程数
|
return ThreadPoolBuilder.builder()
|
||||||
executor.setMaxPoolSize(100);
|
.threadFactory(threadPoolId)
|
||||||
//配置队列大小
|
.threadPoolId(threadPoolId)
|
||||||
executor.setQueueCapacity(1000);
|
.taskDecorator(new TimeoutTraceTaskDecorator())
|
||||||
executor.setKeepAliveSeconds(120000);
|
.dynamicPool()
|
||||||
// rejection-policy:当pool已经达到max size的时候,如何处理新任务
|
.build();
|
||||||
// CALLER_RUNS:不在新线程中执行任务,而是有调用者所在的线程来执行
|
|
||||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
|
||||||
//用来设置线程池关闭的时候等待所有任务都完成再继续销毁其他的Bean,这样这些异步任务的销毁就会先于Redis线程池的销毁。
|
|
||||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
|
||||||
//该方法用来设置线程池中任务的等待时间,如果超过这个时候还没有销毁就强制销毁,以确保应用最后能够被关闭,而不是阻塞住。
|
|
||||||
executor.setAwaitTerminationSeconds(20);
|
|
||||||
return executor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doRun(Runnable task, String traceId) {
|
|
||||||
// 异步任务运行前,看父线程是否已经设置了traceId,如果有,则设置成与父线程一致, 如果没有,则设置新的
|
|
||||||
if (StringUtils.isNotBlank(traceId)) {
|
|
||||||
MDC.put(Constant.LOG_TRACE_ID_NAME, traceId);
|
|
||||||
} else {
|
|
||||||
MDC.put(Constant.LOG_TRACE_ID_NAME, UUID.randomUUID().toString());
|
|
||||||
}
|
|
||||||
task.run();
|
|
||||||
}
|
|
||||||
|
|
||||||
private <T> Callable<T> newCallable(Callable<T> task, String traceId) {
|
|
||||||
return () -> {
|
|
||||||
// 异步任务运行前,看父线程是否已经设置了traceId,如果有,则设置成与父线程一致, 如果没有,则设置新的
|
|
||||||
if (StringUtils.isNotBlank(traceId)) {
|
|
||||||
MDC.put(Constant.LOG_TRACE_ID_NAME, traceId);
|
|
||||||
} else {
|
|
||||||
MDC.put(Constant.LOG_TRACE_ID_NAME, UUID.randomUUID().toString());
|
|
||||||
}
|
|
||||||
return task.call();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private ThreadPoolTaskExecutor newThreadPoolTaskExecutor() {
|
|
||||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor() {
|
|
||||||
@Override
|
|
||||||
public void execute(Runnable task) {
|
|
||||||
final String traceId = MDC.get(Constant.LOG_TRACE_ID_NAME);
|
|
||||||
super.execute(() -> {
|
|
||||||
doRun(task, traceId);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@Override
|
|
||||||
public void execute(Runnable task, long startTimeout) {
|
|
||||||
final String traceId = MDC.get(Constant.LOG_TRACE_ID_NAME);
|
|
||||||
super.execute(() -> {
|
|
||||||
doRun(task, traceId);
|
|
||||||
}, startTimeout);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> Future<T> submit(Callable<T> task) {
|
|
||||||
final String traceId = MDC.get(Constant.LOG_TRACE_ID_NAME);
|
|
||||||
return super.submit(newCallable(task, traceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ListenableFuture<?> submitListenable(Runnable task) {
|
|
||||||
final String traceId = MDC.get(Constant.LOG_TRACE_ID_NAME);
|
|
||||||
return super.submitListenable(() -> {
|
|
||||||
doRun(task, traceId);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> ListenableFuture<T> submitListenable(Callable<T> task) {
|
|
||||||
final String traceId = MDC.get(Constant.LOG_TRACE_ID_NAME);
|
|
||||||
return super.submitListenable(newCallable(task, traceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
return executor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局默认线程池,直接使用@Async注解的会用到
|
* 全局默认线程池,直接使用@Async注解的会用到
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Bean(value = AsyncExecutionAspectSupport.DEFAULT_TASK_EXECUTOR_BEAN_NAME)
|
@Bean(value = AsyncExecutionAspectSupport.DEFAULT_TASK_EXECUTOR_BEAN_NAME)
|
||||||
public Executor taskExecutor() {
|
@DynamicThreadPool
|
||||||
ThreadPoolTaskExecutor executor = newThreadPoolTaskExecutor();
|
public ThreadPoolExecutor asyncExecutor() {
|
||||||
// 配置核心线程数
|
String threadPoolId = "async-executor";
|
||||||
executor.setCorePoolSize(10);
|
return ThreadPoolBuilder.builder()
|
||||||
// 配置最大线程数
|
.threadFactory(threadPoolId)
|
||||||
executor.setMaxPoolSize(100);
|
.threadPoolId(threadPoolId)
|
||||||
// 配置队列大小
|
.taskDecorator(new TimeoutTraceTaskDecorator())
|
||||||
executor.setQueueCapacity(1000);
|
.dynamicPool()
|
||||||
// 活跃时间
|
.build();
|
||||||
executor.setKeepAliveSeconds(3600 * 24);
|
|
||||||
// 线程名字前缀
|
|
||||||
executor.setThreadNamePrefix("default-Async-taskExecutor-");
|
|
||||||
// 线程用完的时候直接在调用方所在线程执行
|
|
||||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
|
||||||
//用来设置线程池关闭的时候等待所有任务都完成再继续销毁其他的Bean,这样这些异步任务的销毁就会先于Redis线程池的销毁。
|
|
||||||
executor.setWaitForTasksToCompleteOnShutdown(true);
|
|
||||||
//该方法用来设置线程池中任务的等待时间,如果超过这个时候还没有销毁就强制销毁,以确保应用最后能够被关闭,而不是阻塞住。
|
|
||||||
executor.setAwaitTerminationSeconds(20);
|
|
||||||
return executor;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class TimeoutTraceTaskDecorator implements TaskDecorator {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Runnable decorate(@NotNull Runnable runnable) {
|
||||||
|
String executeTimeoutTrace = ExecutorTraceContextUtil.getAndRemoveTimeoutTrace();
|
||||||
|
String traceId = StringUtils.isBlank(executeTimeoutTrace)? UUIDUitl.get(): executeTimeoutTrace;
|
||||||
|
return () -> {
|
||||||
|
ExecutorTraceContextUtil.putTimeoutTrace(traceId);
|
||||||
|
runnable.run();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,6 +46,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ public class MasterApprenticeService extends BaseService {
|
|||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
public final static String MASTER_GIFT_ID = "master_gift_id";
|
public final static String MASTER_GIFT_ID = "master_gift_id";
|
||||||
public final static String APPRENTICE_GIFT_ID = "apprentice_gift_id";
|
public final static String APPRENTICE_GIFT_ID = "apprentice_gift_id";
|
||||||
|
@@ -11,12 +11,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +31,7 @@ public class SendChatRoomMsgService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RoomQueryService roomQueryService;
|
private RoomQueryService roomQueryService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
private static int defMsgType=100;
|
private static int defMsgType=100;
|
||||||
private Integer BATCH_SIZE = 500;
|
private Integer BATCH_SIZE = 500;
|
||||||
private Gson gson=new Gson();
|
private Gson gson=new Gson();
|
||||||
|
@@ -15,6 +15,7 @@ import org.springframework.core.task.TaskExecutor;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created By LeeNana on 2020/2/19.
|
* Created By LeeNana on 2020/2/19.
|
||||||
@@ -26,7 +27,7 @@ public class ActivitiesTurnTableMsgService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ErBanNetEaseService erBanNetEaseService;
|
private ErBanNetEaseService erBanNetEaseService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下发暴走状态到客户端
|
* 下发暴走状态到客户端
|
||||||
|
@@ -23,6 +23,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by yanpengcheng on 2019/1/22
|
* Created by yanpengcheng on 2019/1/22
|
||||||
@@ -43,7 +44,7 @@ public class ActRedPacketRemindService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ActivityConfigService activityConfigService;
|
ActivityConfigService activityConfigService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
public static final String REMIND_TIMES_BEGIN_FORMAT = "别离开轻寻首页,精彩继续,红包雨即刻到来";
|
public static final String REMIND_TIMES_BEGIN_FORMAT = "别离开轻寻首页,精彩继续,红包雨即刻到来";
|
||||||
public static final String REMIND_END_FORMAT = "本年红包雨即刻已经全部发放完毕,小秘书祝大家新年快乐、财源滚滚";
|
public static final String REMIND_END_FORMAT = "本年红包雨即刻已经全部发放完毕,小秘书祝大家新年快乐、财源滚滚";
|
||||||
|
@@ -72,6 +72,7 @@ import java.io.InputStream;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -131,7 +132,7 @@ public class AnchorFansTeamServiceImpl extends ServiceImpl<AnchorFansTeamMapper,
|
|||||||
@Autowired
|
@Autowired
|
||||||
private GiftSendService giftSendService;
|
private GiftSendService giftSendService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -43,6 +43,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -63,7 +64,7 @@ public class BoxPrizeMessageService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
UsersService usersService;
|
UsersService usersService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
JedisService jedisService;
|
JedisService jedisService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@@ -28,6 +28,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 话题消息发送
|
* 话题消息发送
|
||||||
@@ -40,7 +41,7 @@ public class CommunityMessageService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SendSysMsgService sendSysMsgService;
|
private SendSysMsgService sendSysMsgService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UsersService usersService;
|
private UsersService usersService;
|
||||||
|
|
||||||
|
@@ -34,6 +34,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {这里添加描述}
|
* {这里添加描述}
|
||||||
@@ -59,7 +60,7 @@ public class DynamicCommentService extends CommunityBaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SysConfService sysConfService;
|
private SysConfService sysConfService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布一条评论,并返回记录id
|
* 发布一条评论,并返回记录id
|
||||||
|
@@ -72,6 +72,7 @@ import org.springframework.util.StopWatch;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ public class DynamicService extends CommunityBaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ApplicationContext applicationContext;
|
private ApplicationContext applicationContext;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@@ -47,6 +47,7 @@ import org.springframework.util.StopWatch;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ public class DynamicSquareService extends CommunityBaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWorldService iWorldService;
|
private IWorldService iWorldService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserBlackRecordService userBlackRecordService;
|
private UserBlackRecordService userBlackRecordService;
|
||||||
|
|
||||||
|
@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created By LeeNana on 2019/11/13.
|
* Created By LeeNana on 2019/11/13.
|
||||||
@@ -53,7 +54,7 @@ public class InteractiveService extends CommunityBaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DfaService dfaService;
|
private DfaService dfaService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ public class FirstPageService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserInRoomService userInRoomService;
|
private UserInRoomService userInRoomService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
public List<FirstPageUserVo> buildFirstPageUserVosWithDistance(List<FirstPageRecommendRoom> recommendRoomList, List<GeoResult<UserOnline>> userOnlineGeoList, UserExpand myUserExpand) throws Exception {
|
public List<FirstPageUserVo> buildFirstPageUserVosWithDistance(List<FirstPageRecommendRoom> recommendRoomList, List<GeoResult<UserOnline>> userOnlineGeoList, UserExpand myUserExpand) throws Exception {
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@ import org.springframework.util.StringUtils;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -71,7 +72,7 @@ public class GiftCompoundService {
|
|||||||
RoomService roomService;
|
RoomService roomService;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ErBanNetEaseService erBanNetEaseService;
|
ErBanNetEaseService erBanNetEaseService;
|
||||||
|
@@ -41,6 +41,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,7 +62,7 @@ public class LinearlyPoolPrizeMessageService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
UsersService usersService;
|
UsersService usersService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
JedisService jedisService;
|
JedisService jedisService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@@ -1,26 +1,21 @@
|
|||||||
package com.accompany.business.service.rank;
|
package com.accompany.business.service.rank;
|
||||||
|
|
||||||
import com.accompany.business.model.room.SingleBroadcastPopularity;
|
|
||||||
import com.accompany.business.service.ErBanNetEaseService;
|
import com.accompany.business.service.ErBanNetEaseService;
|
||||||
import com.accompany.business.service.room.RoomRankService;
|
import com.accompany.business.service.room.RoomRankService;
|
||||||
import com.accompany.business.service.room.RoomService;
|
import com.accompany.business.service.room.RoomService;
|
||||||
import com.accompany.business.service.user.UsersService;
|
|
||||||
import com.accompany.common.constant.Attach;
|
import com.accompany.common.constant.Attach;
|
||||||
import com.accompany.common.constant.Constant;
|
import com.accompany.common.constant.Constant;
|
||||||
import com.accompany.common.utils.DateTimeUtil;
|
import com.accompany.common.utils.DateTimeUtil;
|
||||||
import com.accompany.common.utils.UUIDUitl;
|
import com.accompany.common.utils.UUIDUitl;
|
||||||
import com.accompany.core.model.Room;
|
import com.accompany.core.model.Room;
|
||||||
import com.accompany.core.model.Users;
|
|
||||||
import com.accompany.core.service.common.JedisService;
|
import com.accompany.core.service.common.JedisService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -28,6 +23,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -37,14 +33,12 @@ public class PermitRoomTaskService {
|
|||||||
private JedisService jedisService;
|
private JedisService jedisService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoomRankService roomRankService;
|
private RoomRankService roomRankService;
|
||||||
@Autowired
|
|
||||||
private UsersService usersService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoomService roomService;
|
private RoomService roomService;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ErBanNetEaseService erBanNetEaseService;
|
private ErBanNetEaseService erBanNetEaseService;
|
||||||
|
|
||||||
|
@@ -34,9 +34,11 @@ import org.springframework.scheduling.support.CronSequenceGenerator;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -56,8 +58,8 @@ public class RoomFreeGiftService implements InitializingBean, ApplicationListene
|
|||||||
private UserBackpackService userBackpackService;
|
private UserBackpackService userBackpackService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoomQueryService roomQueryService;
|
private RoomQueryService roomQueryService;
|
||||||
@Autowired
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ErBanNetEaseService erBanNetEaseService;
|
private ErBanNetEaseService erBanNetEaseService;
|
||||||
|
|
||||||
|
@@ -29,7 +29,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.core.task.TaskExecutor;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -37,6 +36,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +59,7 @@ public class SingleRoomTaskService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private SingleBroadcastPopularityService singleBroadcastPopularityService;
|
private SingleBroadcastPopularityService singleBroadcastPopularityService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ErBanNetEaseService erBanNetEaseService;
|
private ErBanNetEaseService erBanNetEaseService;
|
||||||
|
|
||||||
|
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {这里添加描述}
|
* {这里添加描述}
|
||||||
@@ -36,7 +37,7 @@ public class TopicBoxMsgService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TopicBoxMsgMapper topicBoxMsgMapper;
|
private TopicBoxMsgMapper topicBoxMsgMapper;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/** 话匣子消息标识 */
|
/** 话匣子消息标识 */
|
||||||
private final String FIELD_CAN_SEND_FLAG = "canSendFlag";
|
private final String FIELD_CAN_SEND_FLAG = "canSendFlag";
|
||||||
|
@@ -38,6 +38,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <br>类描述:
|
* <br>类描述:
|
||||||
@@ -63,7 +64,7 @@ public class VipMessageService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RoomQueryService roomQueryService;
|
private RoomQueryService roomQueryService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开通贵族小秘书消息
|
* 开通贵族小秘书消息
|
||||||
|
@@ -33,6 +33,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <br>类描述:
|
* <br>类描述:
|
||||||
@@ -55,7 +56,7 @@ public class VipTaskService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private VipLevelBizService vipLevelBizService;
|
private VipLevelBizService vipLevelBizService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
private final static Integer max_retry_time = 10;
|
private final static Integer max_retry_time = 10;
|
||||||
|
|
||||||
|
@@ -45,6 +45,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@@ -81,7 +82,7 @@ public class WorldGroupChatService extends BaseService {
|
|||||||
private WorldGroupChatTopicService worldGroupChatTopicService;
|
private WorldGroupChatTopicService worldGroupChatTopicService;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SendSysMsgService sendSysMsgService;
|
private SendSysMsgService sendSysMsgService;
|
||||||
|
@@ -33,6 +33,7 @@ import javax.annotation.Resource;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -48,7 +49,7 @@ public class WorldMessageService extends BaseService {
|
|||||||
private SendSysMsgService sendSysMsgService;
|
private SendSysMsgService sendSysMsgService;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoomService roomService;
|
private RoomService roomService;
|
||||||
|
@@ -41,6 +41,7 @@ import java.util.Comparator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -58,7 +59,7 @@ public class WorldRoomService extends BaseService {
|
|||||||
private WorldGroupChatService worldGroupChatService;
|
private WorldGroupChatService worldGroupChatService;
|
||||||
|
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoomService roomService;
|
private RoomService roomService;
|
||||||
|
@@ -36,6 +36,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -74,7 +75,7 @@ public class WorldService extends BaseService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWorldPreCleanRecordService iWorldPreCleanRecordService;
|
private IWorldPreCleanRecordService iWorldPreCleanRecordService;
|
||||||
@Resource(name = "bizExecutor")
|
@Resource(name = "bizExecutor")
|
||||||
private TaskExecutor bizExecutor;
|
private ThreadPoolExecutor bizExecutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 话题首页
|
* 话题首页
|
||||||
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: prod
|
profiles: prod
|
||||||
@@ -34,5 +34,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,oauth2-dev.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,oauth2-dev.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: prod
|
profiles: prod
|
||||||
@@ -34,5 +34,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: prod
|
profiles: prod
|
||||||
@@ -34,5 +34,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
5
pom.xml
5
pom.xml
@@ -960,6 +960,11 @@
|
|||||||
<version>${rocketmq-spring-boot-starter.version}</version>
|
<version>${rocketmq-spring-boot-starter.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hippo4j</groupId>
|
||||||
|
<artifactId>hippo4j-config-spring-boot-starter</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@@ -10,8 +10,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: dev
|
profiles: dev
|
||||||
@@ -22,8 +22,8 @@ spring:
|
|||||||
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
namespace: 5edc3246-3e69-4be5-a32a-273f0a09ddf6
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
---
|
---
|
||||||
spring:
|
spring:
|
||||||
profiles: prod
|
profiles: prod
|
||||||
@@ -34,5 +34,5 @@ spring:
|
|||||||
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
namespace: 977fb3bc-f5b2-43d7-b9eb-36747405f755
|
||||||
name: ${spring.application.name}
|
name: ${spring.application.name}
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
shared-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
shared-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,database.yml,sysconf.yml
|
refreshable-dataids: application.yml,thirdpart.yml,pay.yml,sysconf.yml,threadpool.yml
|
||||||
|
Reference in New Issue
Block a user