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 2021/05/27 20:07:46 UTC

[GitHub] [rocketmq] jinrongluo opened a new issue #2955: CONSUME_FROM_TIMESTAMP is not working for PushConsumer

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:
users@infra.apache.org



[GitHub] [rocketmq] jinrongluo closed issue #2955: CONSUME_FROM_TIMESTAMP is not working for PushConsumer

Posted by GitBox <gi...@apache.org>.
jinrongluo closed issue #2955:
URL: https://github.com/apache/rocketmq/issues/2955


   


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



[GitHub] [rocketmq] jinrongluo commented on issue #2955: CONSUME_FROM_TIMESTAMP is not working for PushConsumer

Posted by GitBox <gi...@apache.org>.
jinrongluo commented on issue #2955:
URL: https://github.com/apache/rocketmq/issues/2955#issuecomment-852380848


   I found the solution from this post. Thanks.
   
   https://www.cnblogs.com/dingwpmz/p/11946376.html


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



[GitHub] [rocketmq] jinrongluo commented on issue #2955: CONSUME_FROM_TIMESTAMP is not working for PushConsumer

Posted by GitBox <gi...@apache.org>.
jinrongluo commented on issue #2955:
URL: https://github.com/apache/rocketmq/issues/2955#issuecomment-851736972


   hi @vongosling , would you have any comment on this issue? 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