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