crazylunsong edited a comment on issue #278:
URL: https://github.com/apache/rocketmq-spring/issues/278#issuecomment-657082133


   找到了方法 为prepareStart 中设置
   `@Slf4j
   @Service
   @RocketMQMessageListener(topic = "test-topic-1", consumerGroup = 
"my-consumer_test-topic-1")
   public class MyConsumer1 implements RocketMQListener<String>, 
RocketMQPushConsumerLifecycleListener {
       @Override
       public void onMessage(String message) {
           log.info("received message: {}", message);
       }
   
       @Override
       public void prepareStart(final DefaultMQPushConsumer consumer) {
           // set consumer consume message from now
           
consumer.setConsumeFromWhere(ConsumeFromWhere.CONSUME_FROM_TIMESTAMP);
                  
consumer.setConsumeTimestamp(UtilAll.timeMillisToHumanString3(System.currentTimeMillis()));
       }
   }`


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