dtp-引入dtp代替hippop4j
This commit is contained in:
@@ -96,7 +96,7 @@ public class MyApiService {
|
||||
private RoomReciveRankingService roomReciveRankingService;
|
||||
@Autowired
|
||||
private RoomSendRankingService roomSendRankingService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
|
@@ -68,7 +68,7 @@ public class BravoPoolAdminService {
|
||||
@Autowired
|
||||
private BravoUserMetaService userMetaService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2025-03-20";
|
||||
|
@@ -62,7 +62,7 @@ public class Lucky24RecordAdminService {
|
||||
@Autowired
|
||||
private Lucky24RecordMapper recordMapper;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2024-09-20";
|
||||
|
@@ -53,7 +53,7 @@ public class Lucky25RecordAdminService {
|
||||
@Autowired
|
||||
private Lucky25RecordMapper recordMapper;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private String minStartDate = "2025-05-04";
|
||||
|
@@ -42,7 +42,7 @@ public class RechargeRiskUserAdminService {
|
||||
private AccountBlockService accountBlockService;
|
||||
@Autowired
|
||||
private RechargeRiskUserAdminMapper rechargeRiskUserAdminMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public Page<RechargeRiskUserAdminVo> page(Long erbanNo, PageReq req) {
|
||||
|
@@ -77,7 +77,7 @@ public class DynamicDataAdminService extends BaseService {
|
||||
@Autowired
|
||||
private IWorldService iWorldService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public HSSFWorkbook buildPushRecordExcel(List<Dynamic> dynamics) {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.accompany.admin;
|
||||
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
* admin
|
||||
*
|
||||
*/
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@EnableScheduling
|
||||
|
@@ -49,7 +49,7 @@ public class AppVersionAdminController extends BaseController {
|
||||
private AppVersionAdminService appVersionAdminService;
|
||||
@Autowired
|
||||
private TencentCosUploadService uploadService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
|
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.accompany.flowteam.admin;
|
||||
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -13,6 +14,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
* admin
|
||||
*
|
||||
*/
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@EnableScheduling
|
||||
|
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
@@ -90,6 +90,24 @@
|
||||
<version>${rocketmq-spring-boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-nacos</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-webserver</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.dromara.dynamictp</groupId>
|
||||
<artifactId>dynamic-tp-spring-boot-starter-adapter-rocketmq</artifactId>
|
||||
<version>${dynamic-tp.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
@@ -0,0 +1,28 @@
|
||||
package com.accompany.common.config;
|
||||
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
@Slf4j
|
||||
@EnableAsync
|
||||
@Configuration
|
||||
public class ExecutorConfig implements AsyncConfigurer {
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
return SpringContextHolder.getBean("async-executor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex,method,params)->log.error("@Async 执行异步方法{} 错误,参数{}", method, JSON.toJSONString(params), ex);
|
||||
}
|
||||
|
||||
}
|
@@ -1,108 +0,0 @@
|
||||
package com.accompany.business.config;
|
||||
|
||||
import com.accompany.common.aop.ApiRequestLogAspect;
|
||||
import com.accompany.core.base.SpringContextHolder;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.task.TaskDecorator;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@Slf4j
|
||||
@EnableAsync
|
||||
@Configuration
|
||||
public class ExecutorConfig implements AsyncConfigurer {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
public ThreadPoolExecutor bizExecutor() {
|
||||
String threadPoolId = "biz-executor";
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程数
|
||||
executor.setCorePoolSize(5);
|
||||
// 最大线程数
|
||||
executor.setMaxPoolSize(10);
|
||||
// 队列容量
|
||||
executor.setQueueCapacity(100);
|
||||
// 线程空闲时间(秒)
|
||||
executor.setKeepAliveSeconds(60);
|
||||
// 线程名称前缀
|
||||
executor.setThreadNamePrefix(threadPoolId);
|
||||
executor.setTaskDecorator(new MDCDecorator());
|
||||
// 设置拒绝策略
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor.getThreadPoolExecutor();
|
||||
}
|
||||
|
||||
@Bean("async-executor")
|
||||
public ThreadPoolExecutor asyncExecutor() {
|
||||
String threadPoolId = "async-executor";
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程数
|
||||
executor.setCorePoolSize(5);
|
||||
// 最大线程数
|
||||
executor.setMaxPoolSize(10);
|
||||
// 队列容量
|
||||
executor.setQueueCapacity(100);
|
||||
// 线程空闲时间(秒)
|
||||
executor.setKeepAliveSeconds(60);
|
||||
// 线程名称前缀
|
||||
executor.setThreadNamePrefix(threadPoolId);
|
||||
executor.setTaskDecorator(new MDCDecorator());
|
||||
// 设置拒绝策略
|
||||
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// 初始化
|
||||
executor.initialize();
|
||||
return executor.getThreadPoolExecutor();
|
||||
}
|
||||
|
||||
public static class MDCDecorator implements TaskDecorator {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Runnable decorate(@NotNull Runnable runnable) {
|
||||
String mainThreadTraceId = MDC.get(ApiRequestLogAspect.TRACE_UUID);
|
||||
String traceId = !StringUtils.isBlank(mainThreadTraceId)?
|
||||
mainThreadTraceId :
|
||||
UUID.randomUUID().toString();
|
||||
|
||||
return () -> {
|
||||
try {
|
||||
// Right now: @Async thread context !
|
||||
// Restore the Web thread context's MDC data
|
||||
MDC.put(ApiRequestLogAspect.TRACE_UUID, traceId);
|
||||
runnable.run();
|
||||
} finally {
|
||||
MDC.remove(ApiRequestLogAspect.TRACE_UUID);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
return SpringContextHolder.getBean("async-executor");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (ex,method,params)->log.error("@Async 执行异步方法{} 错误,参数{}", method, JSON.toJSONString(params), ex);
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -44,7 +44,7 @@ public class WeekGuildOperatorStatService {
|
||||
private WeekGuildOperatorDetailStatMapper detailStatMapper;
|
||||
@Autowired
|
||||
private GuildService guildService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
|
@@ -36,7 +36,7 @@ public class WeekGuildPartitionStatService {
|
||||
private GuildService guildService;
|
||||
@Autowired
|
||||
private GuildMemberService guildMemberService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public void stat(Integer partitionId, String mondayStr) {
|
||||
|
@@ -34,7 +34,7 @@ public class WeekRechargeAgentPartitionStatService {
|
||||
|
||||
@Autowired
|
||||
private WeekRechargeAgentPartitionStatMapper mapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private GuildUsdBillRecordMapper guildUsdBillRecordMapper;
|
||||
|
@@ -27,6 +27,7 @@ import com.google.gson.Gson;
|
||||
import jodd.util.StringUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -48,6 +49,7 @@ public class AccountBlockService extends ServiceImpl<AccountBlockMapper, Account
|
||||
@Autowired
|
||||
private UsersBaseService usersBaseService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private RoomService roomService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
|
@@ -37,9 +37,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -74,10 +76,8 @@ public class ActivitiesLuckySeaServiceImpl implements ActivitiesLuckySeaService
|
||||
private LuckySeaUserDrawResultService userDrawResultService;
|
||||
@Autowired
|
||||
private LuckySeaUserDrawRecordService userDrawRecordService;
|
||||
@Autowired
|
||||
private Executor taskExecutor;
|
||||
@Autowired
|
||||
private LuckySeaStockService stockService;
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor taskExecutor;
|
||||
|
||||
@Override
|
||||
public void updateUserLuckySeaActPiece(Long uid, Integer packId, Integer packNum) {
|
||||
|
@@ -28,9 +28,11 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -60,8 +62,8 @@ public class ActivityPackMessageService {
|
||||
private UserActPropertyInfoV2Service userActPropertyInfoV2Service;
|
||||
@Autowired
|
||||
private ActivitiesDrawService activitiesDrawService;
|
||||
@Autowired
|
||||
private Executor bizExecutor;
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
|
@@ -49,9 +49,11 @@ import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -87,8 +89,8 @@ public class ClanServiceImpl extends ServiceImpl<ClanMapper, Clan> implements Cl
|
||||
|
||||
@Autowired
|
||||
private ClanRankService clanRankService;
|
||||
@Autowired
|
||||
private Executor taskExecutor;
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor taskExecutor;
|
||||
|
||||
@Override
|
||||
public ClanVO getUserClanInfo(Long uid) {
|
||||
|
@@ -66,7 +66,7 @@ public class FamilyManagerService {
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private FamilyMemberWeekLevelRewardService familyMemberWeekLevelRewardService;
|
||||
|
@@ -75,7 +75,7 @@ public class AgencyMonthSettleService {
|
||||
private MessageRobotPushService messageRobotPushService;
|
||||
@Autowired
|
||||
private WebSecurityConfig webSecurityConfig;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
|
@@ -75,7 +75,7 @@ public class GuildManagerService {
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private GuildDiamondWageService guildDiamondWageService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
|
@@ -52,7 +52,7 @@ public class GuildUsdChannelService {
|
||||
private GuildUsdProdService guildUsdProdService;
|
||||
@Autowired
|
||||
private RechargeUserService rechargeUserService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private GuildUsdBillRecordService guildUsdBillRecordService;
|
||||
|
@@ -61,7 +61,7 @@ public class GuildPolicy2Service {
|
||||
private GuildDiamondClearPolicy2Service guildDiamondClearPolicy2Service;
|
||||
@Autowired
|
||||
private UserPurseService userPurseService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private GuildCrystalSettlementService guildCrystalSettlementService;
|
||||
|
@@ -89,7 +89,7 @@ public class HallManageService extends BaseService {
|
||||
private OtakuRankService otakuRankService;
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor taskExecutor;
|
||||
|
||||
private static final String shareContent = "【複製后打開 %s APP】\n" +
|
||||
|
@@ -43,7 +43,7 @@ public class LevelService extends BaseService implements InitializingBean {
|
||||
private LevelCharmMapper levelCharmMapper;
|
||||
@Autowired
|
||||
private UsersService usersService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private static final ConcurrentHashMap<Integer, LevelExperience> LEVEL_EXPERIENCE_MAP = new ConcurrentHashMap<>();
|
||||
|
@@ -33,7 +33,7 @@ public class BravoRecordService extends ServiceImpl<BravoRecordMapper, BravoReco
|
||||
|
||||
@Autowired
|
||||
private BravoStatMapper statMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public BravoRecord buildRecord(long senderUid, int partitionId, Gift gift, int giftNum, Long roomUid, long receiverUid,
|
||||
|
@@ -30,7 +30,7 @@ public class BravoSettlementService {
|
||||
@Autowired
|
||||
private BravoMsgSendService msgSendService;
|
||||
|
||||
@Async("bizExecutor")
|
||||
@Async("biz-executor")
|
||||
public void sendReward(BravoGiftConfig config, long senderUid, Room room,
|
||||
Gift gift, Map<Long, BravoRecord> recordMap,
|
||||
BigDecimal winGoldNum, BigDecimal afterMultiple){
|
||||
|
@@ -36,7 +36,7 @@ public class Lucky24RecordService extends ServiceImpl<Lucky24RecordMapper, Lucky
|
||||
|
||||
@Autowired
|
||||
private Lucky24StatMapper statMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public Lucky24Record buildRecord(long senderUid, int partitionId, Gift gift, int giftNum, Long roomUid, long receiverUid,
|
||||
|
@@ -25,7 +25,7 @@ public class Lucky24SettlementService {
|
||||
@Autowired
|
||||
private SuperLuckyGiftSendService superLuckyGiftSendService;
|
||||
|
||||
@Async("bizExecutor")
|
||||
@Async("biz-executor")
|
||||
public void sendReward(Lucky24GiftConfig config, long senderUid, Room room, Gift gift, long winGoldNum, long afterMultiple){
|
||||
// 道具奖励
|
||||
double winGoldNumD = (double) winGoldNum;
|
||||
|
@@ -29,7 +29,7 @@ public class Lucky25RecordService extends ServiceImpl<Lucky25RecordMapper, Lucky
|
||||
|
||||
@Autowired
|
||||
private Lucky25StatMapper statMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public Lucky25Record buildRecord(long senderUid, int partitionId, Gift gift, int giftNum, Long roomUid, long receiverUid, Integer poolId,
|
||||
|
@@ -25,7 +25,7 @@ public class Lucky25SettlementService {
|
||||
@Autowired
|
||||
private SuperLuckyGiftSendService superLuckyGiftSendService;
|
||||
|
||||
@Async("bizExecutor")
|
||||
@Async("biz-executor")
|
||||
public void sendReward(Lucky25GiftConfig config, long senderUid, Room room, Gift gift, long winGoldNum, long afterMultiple){
|
||||
// 道具奖励
|
||||
double winGoldNumD = (double) winGoldNum;
|
||||
|
@@ -98,7 +98,7 @@ public class MiniGameForNavServiceImpl implements MiniGameForNavService {
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@Autowired
|
||||
|
@@ -37,7 +37,7 @@ public class PermitRoomTaskService {
|
||||
@Autowired
|
||||
private RoomService roomService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private ErBanNetEaseService erBanNetEaseService;
|
||||
|
@@ -60,7 +60,7 @@ public class RoomBackgroundService extends ServiceImpl<RoomBackgroundMapper, Roo
|
||||
private BillRecordService billRecordService;
|
||||
@Autowired
|
||||
private SendSysMsgService sendSysMsgService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor taskExecutor;
|
||||
|
||||
private final long defaultId = 1L;
|
||||
|
@@ -37,7 +37,6 @@ import com.accompany.business.service.administrator.SuperAdminWebService;
|
||||
import com.accompany.business.service.dfa.DfaService;
|
||||
import com.accompany.business.service.follow.FansRoomService;
|
||||
import com.accompany.business.service.follow.FansService;
|
||||
import com.accompany.business.service.level.LevelService;
|
||||
import com.accompany.business.service.miniGame.MiniGameRoomService;
|
||||
import com.accompany.business.service.miniGame.MiniGameService;
|
||||
import com.accompany.business.service.miniGame.MiniGameSwitchRecordService;
|
||||
@@ -79,7 +78,6 @@ import com.accompany.core.service.region.RegionInfoService;
|
||||
import com.accompany.core.util.BeanUtils;
|
||||
import com.accompany.core.util.I18NMessageSourceUtil;
|
||||
import com.accompany.core.util.PartitionUtil;
|
||||
import com.accompany.core.vo.UserVo;
|
||||
import com.accompany.sharding.mapper.GiftSendRecordMapperExpand;
|
||||
import com.accompany.sharding.model.GiftSendRecord;
|
||||
import com.accompany.sharding.vo.RoomSerialVo;
|
||||
@@ -102,11 +100,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.accompany.business.constant.RoomConstant.RedisKey.*;
|
||||
@@ -160,8 +156,6 @@ public class RoomService extends BaseService {
|
||||
@Lazy
|
||||
private SuperAdminWebService superAdminWebService;
|
||||
@Autowired
|
||||
private LevelService levelService;
|
||||
@Autowired
|
||||
private DfaService dfaService;
|
||||
@Autowired
|
||||
private RobotV2Service robotV2Service;
|
||||
|
@@ -42,11 +42,13 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.accompany.common.constant.Constant.VipAuthType.VISIT_HIDE;
|
||||
@@ -77,8 +79,8 @@ public class UserDetailsService extends BaseService {
|
||||
private RechargeUserService rechargeUserService;
|
||||
@Autowired
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private Executor taskExecutor;
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor taskExecutor;
|
||||
@Autowired
|
||||
private UserGamePartnerInfoService userGamePartnerInfoService;
|
||||
@Autowired
|
||||
|
@@ -51,7 +51,7 @@ public class VipTaskService {
|
||||
private VipLevelBizService vipLevelBizService;
|
||||
@Autowired
|
||||
private VipReturnProfitRecordService vipReturnProfitRecordService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private UserMedalService userMedalService;
|
||||
|
@@ -94,7 +94,7 @@ public class RewardUtil {
|
||||
@Autowired
|
||||
private UserGoldBeanService userGoldBeanService;
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
public List<RewardVo> sendRewardByUid(Long uid,
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.accompany.business;
|
||||
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -16,6 +17,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
|
||||
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
|
@@ -96,7 +96,7 @@ public class UsersController extends BaseController {
|
||||
private PrivatePhotoService privatePhotoService;
|
||||
@Autowired
|
||||
private RoomService roomService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private AudioCardService audioCardService;
|
||||
|
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: bussiness-threadpool.yml
|
||||
- data-id: bussiness-dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: bussiness-threadpool.yml
|
||||
- data-id: bussiness-dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
@@ -85,6 +85,7 @@
|
||||
<pinyin4j.version>2.5.1</pinyin4j.version>
|
||||
<cloudauth20190307.version>1.0.1</cloudauth20190307.version>
|
||||
<aws.version>2.30.37</aws.version>
|
||||
<dynamic-tp.version>1.2.2</dynamic-tp.version>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package com.accompany.oauth2;
|
||||
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -9,6 +10,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan("com.accompany")
|
||||
@ServletComponentScan(value = {"com.accompany", "com.xuanyin"})
|
||||
|
@@ -30,7 +30,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -53,7 +53,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
@@ -26,7 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
public class RefreshPersonTask extends BaseTask {
|
||||
@Autowired
|
||||
private RoomService roomService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@SneakyThrows
|
||||
|
@@ -20,7 +20,7 @@ public class UserRechargeLevelTask {
|
||||
private UserRechargeLevelService service;
|
||||
@Autowired
|
||||
private DiamondGiveHistoryMapper diamondGiveHistoryMapper;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@Scheduled(cron = "1 0 0 * * ?")
|
||||
|
@@ -19,7 +19,7 @@ public class GuildPolicy2SettlementTask {
|
||||
|
||||
@Autowired
|
||||
private GuildPolicy2Service guildPolicy2Service;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
/**
|
||||
|
@@ -22,7 +22,7 @@ public class SSGuildTask {
|
||||
|
||||
@Autowired
|
||||
private SSGuildService ssGuildService;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
private static final DateTimeFormatter dateFormatters = DateTimeFormatter.ofPattern(DateTimeUtil.DEFAULT_DATETIME_PATTERN);
|
||||
|
@@ -32,7 +32,7 @@ public class BravoTask {
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private BravoRecordService service;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@Autowired
|
||||
|
@@ -19,7 +19,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
@Slf4j
|
||||
public class Lucky24WeekRankTask {
|
||||
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
@Autowired
|
||||
private Lucky24SendWeekRankRewardService service;
|
||||
|
@@ -31,7 +31,7 @@ public class Lucky25Task {
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private Lucky25RecordService service;
|
||||
@Resource(name = "bizExecutor")
|
||||
@Resource(name = "biz-executor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@Autowired
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.accompany.scheduler;
|
||||
|
||||
import io.micrometer.core.instrument.MeterRegistry;
|
||||
import org.dromara.dynamictp.spring.annotation.EnableDynamicTp;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
* @author PaperCut
|
||||
* @date 2018/6/11
|
||||
*/
|
||||
@EnableDynamicTp
|
||||
@SpringBootApplication
|
||||
@ComponentScan({"com.accompany","com.xuanyin"})
|
||||
@EnableScheduling
|
||||
|
@@ -27,7 +27,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
|
||||
---
|
||||
@@ -50,7 +50,7 @@ spring:
|
||||
refresh: true
|
||||
- data-id: sysconf.yml
|
||||
refresh: true
|
||||
- data-id: threadpool.yml
|
||||
- data-id: dtp.yml
|
||||
refresh: true
|
||||
- data-id: database.yml
|
||||
refresh: true
|
||||
|
Reference in New Issue
Block a user