mq-调低每个消费组底层消费线程池的核心线程数

This commit is contained in:
2025-09-25 14:45:21 +08:00
parent 684192bf6c
commit accafa97cd
13 changed files with 13 additions and 14 deletions

View File

@@ -34,7 +34,7 @@ import java.util.concurrent.ThreadPoolExecutor;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.ACT_TASK_REWARD_TOPIC, consumerGroup = MqConstant.ACT_TASK_REWARD_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.ACT_TASK_REWARD_TOPIC, consumerGroup = MqConstant.ACT_TASK_REWARD_CONSUME_GROUP, consumeThreadNumber = 2)
public class ActTaskRewardConsumer extends AbstractMessageListener<ActTaskRewardMqMessage> {
@Autowired

View File

@@ -42,7 +42,7 @@ import java.util.stream.Collectors;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.ACT_USER_TASK_TOPIC, consumerGroup = MqConstant.ACT_USER_TASK_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.ACT_USER_TASK_TOPIC, consumerGroup = MqConstant.ACT_USER_TASK_CONSUME_GROUP, consumeThreadNumber = 2)
public class ActUserTaskConsumer extends AbstractMessageListener<ActUserTaskMqMessage> {
@Autowired

View File

@@ -23,7 +23,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.ACTIVITY_PACK_TOPIC, consumerGroup = MqConstant.ACTIVITY_PACK_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.ACTIVITY_PACK_TOPIC, consumerGroup = MqConstant.ACTIVITY_PACK_CONSUME_GROUP, consumeThreadNumber = 2)
public class ActivityPackMessageConsumer extends AbstractMessageListener<ActivityPackMessage> {
@Autowired

View File

@@ -13,8 +13,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.BILL_RECORD_TOPIC, consumerGroup = MqConstant.BILL_RECORD_CONSUME_GROUP)
//@RocketMQMessageListener(topic = MqConstant.BILL_RECORD_TOPIC, consumerGroup = MqConstant.BILL_RECORD_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY)
@RocketMQMessageListener(topic = MqConstant.BILL_RECORD_TOPIC, consumerGroup = MqConstant.BILL_RECORD_CONSUME_GROUP, consumeThreadNumber = 16)
public class BillMessageConsumer extends AbstractMessageListener<BillMessage> {
@Autowired

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.BRAVO_TOPIC, consumerGroup = MqConstant.BRAVO_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.BRAVO_TOPIC, consumerGroup = MqConstant.BRAVO_CONSUME_GROUP, consumeThreadNumber = 8)
public class BravoMessageConsumer extends AbstractMessageListener<BravoMessage> {
@Autowired

View File

@@ -18,7 +18,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.GAME_MSG_PUSH_TOPIC, consumerGroup = MqConstant.GAME_MSG_PUSH_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.GAME_MSG_PUSH_TOPIC, consumerGroup = MqConstant.GAME_MSG_PUSH_CONSUME_GROUP, consumeThreadNumber = 8)
public class GameMsgPushMessageConsumer extends AbstractMessageListener<GameMsgMessage> {
@Autowired

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.GIFT_TOPIC, consumerGroup = MqConstant.GIFT_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.GIFT_TOPIC, consumerGroup = MqConstant.GIFT_CONSUME_GROUP, consumeThreadNumber = 16)
//@RocketMQMessageListener(topic = MqConstant.GIFT_TOPIC, consumerGroup = MqConstant.GIFT_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY)
public class GiftMessageConsumer extends AbstractMessageListener<GiftMessage> {

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.LUCKY_24_TOPIC, consumerGroup = MqConstant.LUCKY_24_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.LUCKY_24_TOPIC, consumerGroup = MqConstant.LUCKY_24_CONSUME_GROUP, consumeThreadNumber = 16)
public class Lucky24MessageConsumer extends AbstractMessageListener<Lucky24Message> {
@Autowired

View File

@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.LUCKY_25_TOPIC, consumerGroup = MqConstant.LUCKY_25_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.LUCKY_25_TOPIC, consumerGroup = MqConstant.LUCKY_25_CONSUME_GROUP, consumeThreadNumber = 4)
public class Lucky25MessageConsumer extends AbstractMessageListener<Lucky25Message> {
@Autowired

View File

@@ -19,7 +19,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.MINI_GAME_MATCH_ROUND_TOPIC, consumerGroup = MqConstant.MINI_GAME_MATCH_ROUND_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.MINI_GAME_MATCH_ROUND_TOPIC, consumerGroup = MqConstant.MINI_GAME_MATCH_ROUND_CONSUME_GROUP, consumeThreadNumber = 4)
public class MiniGameMatchRoundMessageConsumer extends AbstractMessageListener<MiniGameMatchRoundMessage> {
@Autowired

View File

@@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.OPEN_BOX_TOPIC, consumerGroup = MqConstant.OPEN_BOX_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY)
@RocketMQMessageListener(topic = MqConstant.OPEN_BOX_TOPIC, consumerGroup = MqConstant.OPEN_BOX_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY, consumeThreadNumber = 4)
public class OpenBoxPrizeMessageConsumer extends AbstractMessageListener<BoxPrizeMessage> {
@Autowired

View File

@@ -24,7 +24,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.PAY_FINISH_TOPIC, consumerGroup = MqConstant.PAY_FINISH_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.PAY_FINISH_TOPIC, consumerGroup = MqConstant.PAY_FINISH_CONSUME_GROUP, consumeThreadNumber = 4)
public class PayFinishMessageConsumer extends AbstractMessageListener<PayFinishMessage> {
@Autowired

View File

@@ -19,7 +19,7 @@ import org.springframework.stereotype.Component;
@Slf4j
@Component
@ConditionalOnProperty(name = "spring.application.name", havingValue = "web")
@RocketMQMessageListener(topic = MqConstant.YI_DUN_TEXT_ANTI_TOPIC, consumerGroup = MqConstant.YI_DUN_TEXT_ANTI_CONSUME_GROUP)
@RocketMQMessageListener(topic = MqConstant.YI_DUN_TEXT_ANTI_TOPIC, consumerGroup = MqConstant.YI_DUN_TEXT_ANTI_CONSUME_GROUP, consumeThreadNumber = 2)
public class YiDunIMTextAntiMessageConsumer extends AbstractMessageListener<YidunIMAntiMessage> {
@Autowired