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 2020/12/09 03:40:37 UTC

[GitHub] [rocketmq-spring] YuLoving opened a new issue #322: rocketmq-spring在消费端如何控制重试次数

YuLoving opened a new issue #322:
URL: https://github.com/apache/rocketmq-spring/issues/322


   使用rocketMQ原生的API实现MessageListenerConcurrently接口来控制消费端指定重试次数,但是rocketmq-spring在消费端如何控制重试次数,rocketmq-spring需要实现RocketMQListener<MessageExt>接口的onMessage方法,而此方法是void型的,默认自动重试下去,如果一直失败就要重试16次才会进入私信队列。那么rocketmq-spring如何在消费端控制重试次数呢


----------------------------------------------------------------
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-spring] RongtongJin commented on issue #322: rocketmq-spring在消费端如何控制重试次数

Posted by GitBox <gi...@apache.org>.
RongtongJin commented on issue #322:
URL: https://github.com/apache/rocketmq-spring/issues/322#issuecomment-742473996


   Like this:
   ```java
   /**
    * StringConsumer
    */
   @Service
   @RocketMQMessageListener(topic = "${demo.rocketmq.topic}", consumerGroup = "string_consumer", selectorExpression = "${demo.rocketmq.tag}")
   public class StringConsumer implements RocketMQListener<String> , RocketMQPushConsumerLifecycleListener {
       @Override
       public void onMessage(String message) {
           System.out.printf("------- StringConsumer received: %s \n", message);
       }
   
       public void prepareStart(DefaultMQPushConsumer consumer) {
           consumer.setMaxReconsumeTimes(4);
       }
   }
   ```


----------------------------------------------------------------
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-spring] RongtongJin closed issue #322: rocketmq-spring在消费端如何控制重试次数

Posted by GitBox <gi...@apache.org>.
RongtongJin closed issue #322:
URL: https://github.com/apache/rocketmq-spring/issues/322


   


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