You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/01/30 14:16:44 UTC

[GitHub] [rocketmq] zhangdp-taozi opened a new issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.

zhangdp-taozi opened a new issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.
URL: https://github.com/apache/rocketmq/issues/1752
 
 
   The issue tracker is **ONLY** used for bug report(feature request need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). Keep in mind, please check whether there is an existing same report before your raise a new one.
   
   Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration and other improvements.
   
   Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - What did you do (The steps to reproduce)?
     when I consume the message, increase the value of consumeThreadMax doesn't work.
   
   - What did you expect to see?
    I expert consume speed will be faster when increase the value of consumeThreadMax
   
   - What did you see instead?
   the consume speed  keep stable even I increase the value of consumeThreadMax
   
   2. Please tell us about your environment:
    4.3.0, I checked the lasted version, it still happens.
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   
   I found some in the class ConsumeMessageConcurrentlyService:
       public ConsumeMessageConcurrentlyService(DefaultMQPushConsumerImpl defaultMQPushConsumerImpl,
           MessageListenerConcurrently messageListener) {
           this.defaultMQPushConsumerImpl = defaultMQPushConsumerImpl;
           this.messageListener = messageListener;
   
           this.defaultMQPushConsumer = this.defaultMQPushConsumerImpl.getDefaultMQPushConsumer();
           this.consumerGroup = this.defaultMQPushConsumer.getConsumerGroup();
           this.consumeRequestQueue = new LinkedBlockingQueue<Runnable>();
   
           this.consumeExecutor = new ThreadPoolExecutor(
               this.defaultMQPushConsumer.getConsumeThreadMin(),
               this.defaultMQPushConsumer.getConsumeThreadMax(),
               1000 * 60,
               TimeUnit.MILLISECONDS,
               this.consumeRequestQueue,
               new ThreadFactoryImpl("ConsumeMessageThread_"));
   
           this.scheduledExecutorService = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryImpl("ConsumeMessageScheduledThread_"));
           this.cleanExpireMsgExecutors = Executors.newSingleThreadScheduledExecutor(new ThreadFactoryImpl("CleanExpireMsgScheduledThread_"));
       }
   
   This constructor take unbounded queue(new LinkedBlockingQueue<Runnable>())  as  workQueue,it has a risk that when new task comes, if the number equals to consumeThreadMin, it will be pushed to the unbounded queue, the consume thread number will NEVER be increased. so the consumeThreadMax value will NEVER work。 so consumeRequestQueue should be assigned as a bounded queue as workQueue, like this.consumeRequestQueue = new LinkedBlockingQueue<Runnable>(128);
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [rocketmq] duhenglucky commented on issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.

Posted by GitBox <gi...@apache.org>.
duhenglucky commented on issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.
URL: https://github.com/apache/rocketmq/issues/1752#issuecomment-586139566
 
 
   yep, so it would be better to set minThread equals with maxThread, but if you want to replace with a  bounded queue as workQueue,  it will lead to the message lost in the condition of this queue is full :).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [rocketmq] duhenglucky closed issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.

Posted by GitBox <gi...@apache.org>.
duhenglucky closed issue #1752: RocketMQ consume with number of consumeThreadMin, consumeThreadMax value doesn't work.
URL: https://github.com/apache/rocketmq/issues/1752
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services