apache / apache/rocketmq-spring

为什么要在5.x弃用consumeThreadMax

Open
#748 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2.3k
Forks
943
PR merge metrics
No merged PRs in 30d

Description

由于consumeThreadMin和consumeThreadMax在5.x版本当中被弃用,我有几个问题
1. 由于线程数量无法再设置核心线程数以及最大线程数,线程数量只能设置为固定线程,假设我设置为固定20,如果我在多Topic的情况下,一旦项目启动并创建了消费者,那么创建的消费者线程数量就将会是 n(topic数量) * 20, 这样就会有大量的线程进入Waiting状态并浪费资源
2. 消费者线程数调低会导致业务高峰期消费不及时
3. 如果按照上述逻辑,并且合并Topic也会有问题,如果同一Topic内,多个业务逻辑比如A、B、C,其中A会产生大量消息,B、C很少,如果A产生了大量消息并导致堆积会造成B、C也造成堆积

所以结合上述的问题,为什么不设计成允许动态线程池,低峰期自动降低线程数,高峰期自动开辟线程到最大线程数,队列满之后的线程认为来不及处理不处理呢,虚心请教一下

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points. Start by tracing the 5.x consumer-thread configuration and the rationale for deprecating consumeThreadMax, then examine the multi-topic and merged-topic cases described. Done would require an agreed design and maintainer decision on dynamic thread-pool behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.