You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "onejimmyboy (via GitHub)" <gi...@apache.org> on 2023/03/21 07:07:26 UTC

[GitHub] [rocketmq] onejimmyboy commented on issue #6427: Dledger Model。When a user consumes a delay message for an arbitrary period of time, when the broker performs a master-slave switch, will they repeatedly consume it?

onejimmyboy commented on issue #6427:
URL: https://github.com/apache/rocketmq/issues/6427#issuecomment-1477366550

   消费者demo
   import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
   import org.apache.rocketmq.spring.core.RocketMQListener;
   import org.apache.rocketmq.spring.core.RocketMQReplyListener;
   import org.springframework.beans.factory.annotation.Value;
   import org.springframework.stereotype.Component;
   
   @Component
   @RocketMQMessageListener(consumerGroup = "${rocketmq.consumer.group}", topic = "${consumer.topic}")
   public class RocketMQConsumer001 implements RocketMQListener<String> {
       @Value("${consumer.topic}")
       private String topicName;
       @Value("${rocketmq.consumer.group}")
       private String groupName;
   
       @Override
       public void onMessage(String s) {
           System.out.println("groupName :" + groupName + ":from topicName: " + topicName+",监听的消息内容为:"+s);
       }
   }


-- 
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-unsubscribe@rocketmq.apache.org

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