账单-mq-尝试通过修改createTime毫秒位,追求批量送礼时createTime顺序不追求主键顺序,修改gift和bill为随机顺序mq

This commit is contained in:
khalil
2025-01-13 22:06:37 +08:00
parent d82f433306
commit 19809f362b
4 changed files with 20 additions and 7 deletions

View File

@@ -14,7 +14,8 @@ 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, consumeMode = ConsumeMode.ORDERLY)
@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)
public class BillMessageConsumer extends AbstractMessageListener<BillMessage> {
@Autowired

View File

@@ -5,7 +5,6 @@ import com.accompany.business.service.gift.GiftMessageService;
import com.accompany.mq.constant.MqConstant;
import com.accompany.mq.listener.AbstractMessageListener;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
@@ -14,8 +13,8 @@ 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, consumeMode = ConsumeMode.ORDERLY)
@RocketMQMessageListener(topic = MqConstant.GIFT_TOPIC, consumerGroup = MqConstant.GIFT_CONSUME_GROUP)
//@RocketMQMessageListener(topic = MqConstant.GIFT_TOPIC, consumerGroup = MqConstant.GIFT_CONSUME_GROUP, consumeMode = ConsumeMode.ORDERLY)
public class GiftMessageConsumer extends AbstractMessageListener<GiftMessage> {
@Autowired