MatrixHB opened a new issue #3860:
URL: https://github.com/apache/rocketmq/issues/3860
In consumer client code `ConsumeMessageConcurrentlyService`, there is a
scheduled executor used to clean the expired messages(consuming-blocked
messages) in `ProcessQueue`.
```
this.cleanExpireMsgExecutors.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
cleanExpireMsg();
}
}, this.defaultMQPushConsumer.getConsumeTimeout(),
this.defaultMQPushConsumer.getConsumeTimeout(), TimeUnit.MINUTES);
```
When using `scheduleAtFixedRate`, once a thread throws an exception, it will
not continue to execute the following threads. So the Runnable must be
surrounded by try-catch.
Since the scheduleAtFixedRate without try-catch, the `cleanExpireMsg` thread
may abnormally exit and never be executed again, which may cause the
consuming-blocked message always stay in `ProcessQueue`, resulting in the
consume offset get stuck. (We have actually met this problem in production
environment.)
--
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]