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/05/21 03:09:51 UTC

[GitHub] [rocketmq] sunxi92 opened a new issue #2931: fix and optimize methods for sending and storing batch message

sunxi92 opened a new issue #2931:
URL: https://github.com/apache/rocketmq/issues/2931


   1.refactor public static byte[] encodeMessages(List<Message> messages) in MessageDecoder.java to reduce the number of copies of data
   
   2.**BUG REPORT**
   (1). Please describe the issue you observed:
   The method public static boolean validateTopic(String topic, RemotingCommand response) in TopicValidator.java is used to check the topic, and when topic does not comply with regulations, the response's code will be set ResponseCode.SYSTEM_ERROR. I think it's better for user  that the response'code wiil be  set ResponseCode.MESSAGE_ILLEGAL
   - What did you do (The steps to reproduce)?
   - What did you expect to see?
   - What did you see instead?
   (2). Please tell us about your environment:
   (3). Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc):
   
   3.when broker process the request RequestCode.SEND_BATCH_MESSAGE, the method private CompletableFuture<RemotingCommand> asyncSendBatchMessage(ChannelHandlerContext ctx, RemotingCommand request, SendMessageContext mqtraceContext, SendMessageRequestHeader requestHeader) will be called, and the topic is checked repeatedly in this method.
   ![image](https://user-images.githubusercontent.com/25401190/119074957-8ea89780-ba22-11eb-8b28-8c33ee779b08.png)
   In the method preSend, msgCheck(final ChannelHandlerContext ctx,final SendMessageRequestHeader requestHeader, final RemotingCommand response) is called, and it contains the logic of topic checking
   
   4.when broker store batch message,I think it is better to distinguish between two exceptions in the method public ByteBuffer encode(final MessageExtBatch messageExtBatch) of Commitlog.java
   ![image](https://user-images.githubusercontent.com/25401190/119075802-fe6b5200-ba23-11eb-9192-e8cccb7a3f98.png)
   
   


-- 
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.

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