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 2021/07/23 00:55:47 UTC

[GitHub] [rocketmq] ozw999 edited a comment on issue #3143: MQClientInstance has a risk of blocking during persistAllConsumerOffset()

ozw999 edited a comment on issue #3143:
URL: https://github.com/apache/rocketmq/issues/3143#issuecomment-885331059


   是的。所有的消费持久化最后都会依次通过 `org.apache.rocketmq.remoting.netty#invokeSync()` 去执行,且超时时间是5s。这将造成非常恐怖的阻塞。
   ```
       if (isOneway) {
           this.mQClientFactory.getMQClientAPIImpl().updateConsumerOffsetOneway(
           findBrokerResult.getBrokerAddr(), requestHeader, 1000 * 5);
           } else {
               this.mQClientFactory.getMQClientAPIImpl().updateConsumerOffset(
               findBrokerResult.getBrokerAddr(), requestHeader, 1000 * 5);
           }
   ```
   改用异步调用似乎是一个更好的解决方案。 `org.apache.rocketmq.remoting.netty#invokeAsync()`
   @duhenglucky 我觉得这不仅仅是一个”question“而已呀


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

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