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 2019/09/17 05:58:29 UTC

[GitHub] [rocketmq-spring] RongtongJin commented on issue #144: 请问如何设置消费者线程数,因为消费太慢

RongtongJin commented on issue #144: 请问如何设置消费者线程数,因为消费太慢
URL: https://github.com/apache/rocketmq-spring/issues/144#issuecomment-532071787
 
 
   You can set consume thread number by calling setConsumeThreadMin/setConsumeThreadMax in prepareStart method. 
   ```java
   @Slf4j
   @Service
   @RocketMQMessageListener(topic = "test-topic-1", consumerGroup = "my-consumer_test-topic-1")
   public class MyConsumer1 implements RocketMQListener<String>, RocketMQPushConsumerLifecycleListener {
       @Override
       public void onMessage(String message) {
           log.info("received message: {}", message);
       }
   
       @Override
       public void prepareStart(final DefaultMQPushConsumer consumer) {
           // set consume thread number
          consumer.setConsumeThreadMin(xx);
          consumer.setConsumeThreadMax(xx);
       }
   }
   
   ```

----------------------------------------------------------------
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