[ISSUE #3949] Fix batch sendMessageAsync

This commit is contained in:
zhouxiang
2022-07-13 11:29:37 +08:00
parent 0ad9b3adb1
commit f334ca18df
@@ -190,8 +190,10 @@ public class MQClientAPIExt extends MQClientAPIImpl {
requestHeader.setBatch(true);
MessageBatch msgBatch = MessageBatch.generateFromList(msgList);
MessageClientIDSetter.setUniqID(msgBatch);
msgBatch.setBody(msgBatch.encode());
byte[] body = msgBatch.encode();
msgBatch.setBody(body);
request.setBody(body);
this.getRemotingClient().invokeAsync(brokerAddr, request, timeoutMillis, responseFuture -> {
RemotingCommand response = responseFuture.getResponseCommand();
if (response != null) {