RongtongJin commented on issue #184: The config 'consumeThreadMax' is useless 
in annotation @RocketMQMessageListener
URL: https://github.com/apache/rocketmq-spring/issues/184#issuecomment-559430882
 
 
   > > This parameter is valid. The relevant code is below
   > > 
https://github.com/apache/rocketmq-spring/blob/e5f28fec78f98b2ce877a4f4f4b1fbbcae248933/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java#L208
   > > 
   > > 
https://github.com/apache/rocketmq-spring/blob/e5f28fec78f98b2ce877a4f4f4b1fbbcae248933/rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/support/DefaultRocketMQListenerContainer.java#L468
   > > 
   > > Because this is the maximum number of threads in the thread pool, the 
maximum number of threads will not be reached when the concurrency is small.
   > 
   > thank you for your reply!
   > For 'rocketmq-spring', this parameter is "valid". However, after reading 
the source code of rocketmq-client, in class 'ConsumeMessageConcurrentlyService'
   > 
   > ```
   >         this.consumeRequestQueue = new LinkedBlockingQueue<Runnable>();
   > 
   >         this.consumeExecutor = new ThreadPoolExecutor(
   >             this.defaultMQPushConsumer.getConsumeThreadMin(),
   >             this.defaultMQPushConsumer.getConsumeThreadMax(),
   >             1000 * 60,
   >             TimeUnit.MILLISECONDS,
   >             this.consumeRequestQueue,
   >             new ThreadFactoryImpl("ConsumeMessageThread_"));
   > ```
   > 
   > You will find that the threads will only increase when the 
LinkedBlockingQueue is full, but the queue has no capacity set. So the thread 
never grows to its maximum.
   > ThreadPoolExecutor only increases threads to the maximum when using a 
SynchronousQueue queue or a LinkedBlockingQueue with limited capacity.
   > If we use RocketMQMessageListener to declare consumers, we have no way to 
increase the number of threads to more than 20.
   
   You are right. And you can submit a issue to the rocketmq main repo.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to