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


With regards,
Apache Git Services

Reply via email to