jinrongluo opened a new issue #2955:
URL: https://github.com/apache/rocketmq/issues/2955


   I am playing with PushConsumer's ConsumeFromWhere.CONSUME_FROM_TIMESTAMP for 
new consumerGroup.
   
   When I start the new consumer with the setting above, I expect to consume 
the messages after timestamp. But I am still getting the historical messages.
   
   1. RocketMQ
   Version 4.8.0, single instance
   
   broker.conf 
   
   ```
   brokerClusterName = DefaultCluster
   brokerName = broker-a
   brokerId = 0
   deleteWhen = 04
   fileReservedTime = 48
   brokerRole = ASYNC_MASTER
   flushDiskType = ASYNC_FLUSH
   enablePropertyFilter=true
   ```
   
   2. Consumer App
   
   ```
   public class App {
       public static void main(String[] args) throws Exception {
           DefaultMQPushConsumer consumer = new 
DefaultMQPushConsumer("new_group");
           consumer.setNamesrvAddr("127.0.0.1:9876");
           consumer.subscribe("testtopic", "*");
           
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_TIMESTAMP);
           consumer.setConsumeTimestamp("20210530101010");
           consumer.registerMessageListener(new MessageListenerConcurrently() {
               @Override
               public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> 
msgs, ConsumeConcurrentlyContext context) {
                   System.out.printf("consumer %s, group %s Receive New 
Messages: %s %n", "consumer1", "consumerGroup1", msgs);
                   return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
               }
           });
           consumer.start();
       }
   }
   ```


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


Reply via email to