lwclover commented on a change in pull request #3981:
URL: https://github.com/apache/rocketmq/pull/3981#discussion_r833926435
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
##########
@@ -135,7 +135,8 @@ public DefaultMQProducerImpl(final DefaultMQProducer
defaultMQProducer, RPCHook
public Thread newThread(Runnable r) {
return new Thread(r, "AsyncSenderExecutor_" +
this.threadIndex.incrementAndGet());
}
- });
+ },
+ new ThreadPoolExecutor.CallerRunsPolicy());
Review comment:
本质上还是想发送成功的,默认的线程池AbortPolicy当阻塞队列满时抛出异常;而CallerRunsPolicy提供简单的反馈控制机制,能够减缓新任务的提交速度。我的出发点是尽量发送成功。
--
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]