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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to