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/02/06 03:57:53 UTC

[GitHub] [rocketmq] mali-nuist opened a new issue #1761: Confusion about LitePullConsumer batch size.

mali-nuist opened a new issue #1761: Confusion about LitePullConsumer batch size.
URL: https://github.com/apache/rocketmq/issues/1761
 
 
   
   1. Please describe the issue you observed:
   batch size of 20 was setted to LitePullConsumer  but after resending messages to the queue, the LitePullConsumer can only pull one message each time when consuming these resent messages.
   - What did you do (The steps to reproduce)?
   I modify the following code into springboot service code. 
    '''
      DefaultLitePullConsumer litePullConsumer = new DefaultLitePullConsumer("please_rename_unique_group_name");
           litePullConsumer.setNamesrvAddr("192.168.183.129:9876");
           litePullConsumer.subscribe("tt", "*");
           litePullConsumer.setPullBatchSize(20);
           litePullConsumer.start();
           try {
               while (running) {
                   List<MessageExt> messageExts = litePullConsumer.poll();
                   System.out.printf("%s%n", messageExts.size());
               }
           } finally {
               litePullConsumer.shutdown();
           }
   '''
   In the service Code DefaultLiteConsumer was constructed in the @PostConstruct method and the instance was the Instance field of the Service class.
   
   so, for each request, i execute litePullConsumer.poll() and return the messages to users.
   
   - What did you expect to see?
   I hope the consumer to featch exactly 20 messages when each queue have enough messages.
   
   - What did you see instead?
   After the Consumer  featchd all the old messages and then pull these resent messages, each time it only can get one message. But when i restart the the springboot service , it  will featch 20 messages again.
   
   I quite confuse about this phonemon and Hope to get some suggestions.
   
   2. Please tell us about your environment:
    RocketMq 4.6.0  ubuntu single master single nameserver
    Program: window10 
    
   3. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   
   

----------------------------------------------------------------
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] mali-nuist commented on issue #1761: Confusion about LitePullConsumer batch size.

Posted by GitBox <gi...@apache.org>.
mali-nuist commented on issue #1761: Confusion about LitePullConsumer batch size.
URL: https://github.com/apache/rocketmq/issues/1761#issuecomment-582763843
 
 
   @RongtongJin  Ok  thanks! 
   

----------------------------------------------------------------
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] RongtongJin commented on issue #1761: Confusion about LitePullConsumer batch size.

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #1761: Confusion about LitePullConsumer batch size.
URL: https://github.com/apache/rocketmq/issues/1761#issuecomment-582762308
 
 
   Batch size in LitePullConsumer means maximum number of messages pulled each time, so it can't guarantee  that 20 messages will be fetched every time, especially when there's no accumulated messages in broker.

----------------------------------------------------------------
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] mali-nuist closed issue #1761: Confusion about LitePullConsumer batch size.

Posted by GitBox <gi...@apache.org>.
mali-nuist closed issue #1761: Confusion about LitePullConsumer batch size.
URL: https://github.com/apache/rocketmq/issues/1761
 
 
   

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