zhouxinyu commented on a change in pull request #219: [ROCKETMQ-355] Client
asyncSend is not fully async
URL: https://github.com/apache/rocketmq/pull/219#discussion_r161969269
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java
##########
@@ -842,32 +858,34 @@ public SendResult send(Message msg, MessageQueue mq,
long timeout)
/**
* KERNEL ASYNC -------------------------------------------------------
*/
- public void send(Message msg, MessageQueue mq, SendCallback sendCallback)
- throws MQClientException, RemotingException, InterruptedException {
+ public void send(Message msg, MessageQueue mq, SendCallback sendCallback) {
send(msg, mq, sendCallback,
this.defaultMQProducer.getSendMsgTimeout());
}
- public void send(Message msg, MessageQueue mq, SendCallback sendCallback,
long timeout)
- throws MQClientException, RemotingException, InterruptedException {
- this.makeSureStateOK();
- Validators.checkMessage(msg, this.defaultMQProducer);
-
- if (!msg.getTopic().equals(mq.getTopic())) {
- throw new MQClientException("message's topic not equal mq's
topic", null);
- }
+ public void send(final Message msg, final MessageQueue mq, final
SendCallback sendCallback, final long timeout) {
+ this.getCallbackExecutor().submit(new Runnable() {
Review comment:
This method will put a really heavy task into PublicExecutor if the client
doesn't set CallBack executor.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services