xzwb opened a new issue, #7801:
URL: https://github.com/apache/rocketmq/issues/7801

   ### Before Creating the Bug Report
   
   - [X] I found a bug, not just asking a question, which should be created in 
[GitHub Discussions](https://github.com/apache/rocketmq/discussions).
   
   - [X] I have searched the [GitHub 
Issues](https://github.com/apache/rocketmq/issues) and [GitHub 
Discussions](https://github.com/apache/rocketmq/discussions)  of this 
repository and believe that this is not a duplicate.
   
   - [X] I have confirmed that this bug belongs to the current repository, not 
other repositories of RocketMQ.
   
   
   ### Runtime platform environment
   
   OS: mac14.3
   
   ### RocketMQ version
   
   branch: 4.9.x
   
   ### JDK Version
   
   JDK1.8
   
   ### Describe the Bug
   
   This is my pull message cod
   ```java
   public static void main(String[] args) throws MQClientException, 
MQBrokerException, RemotingException, InterruptedException {
           DefaultMQPullConsumer consumer = new 
DefaultMQPullConsumer("pullTopicTest_consumerGroup");
           consumer.setNamesrvAddr("127.0.0.1:9876");
           consumer.start();
           Set<MessageQueue> messageQueues = 
consumer.fetchSubscribeMessageQueues("pulltopictest");
   
           for (MessageQueue messageQueue : messageQueues) {
               long offset = consumer.fetchConsumeOffset(messageQueue, true);
               System.out.println(offset);
               if (offset < 0) {
                   continue;
               }
               PullResult result = consumer.pull(messageQueue, "*", offset, 1, 
3000);
               System.out.println(result);
               long i = result.getNextBeginOffset();
               if (result.getPullStatus() == PullStatus.FOUND) {
                   System.out.println(i);
                   consumer.updateConsumeOffset(messageQueue, i);
   //                offset = consumer.fetchConsumeOffset(messageQueue, true);
   //                System.out.println(offset);
               }
           }
           Thread.sleep(10000);
           consumer.shutdown();
       }
   ```
   
   This code is a simple pull message ,The final sleep is to wait for the 
consumer to submit the location to the server.
   But No matter how long you wait in the end,offset not update to broker
   
   ### 
   
   ### Steps to Reproduce
   
   print
   ```
   9 # fetchSubscribeMessageQueues
   PullResult [pullStatus=FOUND, nextBeginOffset=10, minOffset=0, maxOffset=10, 
msgFoundList=1]
   10 # getNextBeginOffset
   ```
   
   
   Execute discovery multiple times fetchSubscribeMessageQueues always get 
offset 9
   
   ### What Did You Expect to See?
   
   Each execution will get the latest offset
   
   ### What Did You See Instead?
   
   If you set up a scheduled task to start the consumer once a day to pull a 
message, and then submit the offset,this offset cant update to broker。you will 
get the same offset in next time
   
   ### Additional Context
   
   _No response_


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

To unsubscribe, e-mail: commits-unsubscr...@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to