重构第一版,没有明显bug
This commit is contained in:
@@ -25,12 +25,12 @@ import static cn.van.business.util.WXUtil.WX_BASE_URL;
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
@RocketMQMessageListener(topic = "wx-message", consumerGroup = "${rocketmq.consumer.group}", nameServer = "${rocketmq.name-server}", consumeMode = ConsumeMode.ORDERLY // 顺序消费(单线程)
|
||||
@RocketMQMessageListener(topic = "wx-message", consumerGroup = "${rocketmq.consumer.group}", nameServer = "${rocketmq.name-server}"
|
||||
)
|
||||
public class MessageConsumerService implements RocketMQListener<JSONObject> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MessageConsumerService.class);
|
||||
private static final RateLimiter rateLimiter = RateLimiter.create(0.5, // 1 QPS
|
||||
private static final RateLimiter rateLimiter = RateLimiter.create(2, // 1 QPS
|
||||
5, // 预热期 5 秒
|
||||
TimeUnit.SECONDS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user