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/29 16:36:06 UTC

[GitHub] [rocketmq] gorden5566 opened a new issue #3196: Check if "requestHeader" is null before "requestHeader.getTopic()

gorden5566 opened a new issue #3196:
URL: https://github.com/apache/rocketmq/issues/3196


   The issue tracker is **ONLY** used for bug report(feature request need to follow [RIP process](https://github.com/apache/rocketmq/wiki/RocketMQ-Improvement-Proposal)). Keep in mind, please check whether there is an existing same report before your raise a new one.
   
   Alternately (especially if your communication is not a bug report), you can send mail to our [mailing lists](http://rocketmq.apache.org/about/contact/). We welcome any friendly suggestions, bug fixes, collaboration and other improvements.
   
   Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   - 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):
   
   In the `AbstractSendMessageProcessor#executeSendMessageHookBefore` method
   
   ```
   final SendMessageRequestHeader requestHeader = parseRequestHeader(request);
   
   String namespace = NamespaceUtil.getNamespaceFromResource(requestHeader.getTopic());
   if (null != requestHeader) {
       context.setNamespace(namespace);
       context.setProducerGroup(requestHeader.getProducerGroup());
       context.setTopic(requestHeader.getTopic());
       context.setBodyLength(request.getBody().length);
       context.setMsgProps(requestHeader.getProperties());
       context.setBornHost(RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
       context.setBrokerAddr(this.brokerController.getBrokerAddr());
       context.setQueueId(requestHeader.getQueueId());
   }
   ```
   
   Since "requestHeader" is nullable, we should check if it is null before dereference
   


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



[GitHub] [rocketmq] RongtongJin closed issue #3196: Check if "requestHeader" is null before "requestHeader.getTopic()

Posted by GitBox <gi...@apache.org>.
RongtongJin closed issue #3196:
URL: https://github.com/apache/rocketmq/issues/3196


   


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