Github user vongosling commented on a diff in the pull request:
https://github.com/apache/incubator-rocketmq/pull/53#discussion_r101981097
--- Diff:
broker/src/main/java/org/apache/rocketmq/broker/processor/SendMessageProcessor.java
---
@@ -442,6 +449,202 @@ private RemotingCommand sendMessage(final
ChannelHandlerContext ctx, //
return response;
}
+ private RemotingCommand sendBatchMessage(final ChannelHandlerContext
ctx, //
+ final RemotingCommand request, //
+ final SendMessageContext
sendMessageContext, //
+ final SendMessageRequestHeader
requestHeader) throws RemotingCommandException {
+
+ final RemotingCommand response =
RemotingCommand.createResponseCommand(SendMessageResponseHeader.class);
+ final SendMessageResponseHeader responseHeader =
(SendMessageResponseHeader) response.readCustomHeader();
+
+
+ response.setOpaque(request.getOpaque());
+
+ response.addExtField(MessageConst.PROPERTY_MSG_REGION,
this.brokerController.getBrokerConfig().getRegionId());
+ response.addExtField(MessageConst.PROPERTY_TRACE_SWITCH,
String.valueOf(this.brokerController.getBrokerConfig().isTraceOn()));
+
+ if (log.isDebugEnabled()) {
+ log.debug("receive SendMessage request command, " + request);
+ }
+
+ final long startTimstamp =
this.brokerController.getBrokerConfig().getStartAcceptSendRequestTimeStamp();
+ if (this.brokerController.getMessageStore().now() < startTimstamp)
{
+ response.setCode(ResponseCode.SYSTEM_ERROR);
+ response.setRemark(String.format("broker unable to service,
until %s", UtilAll.timeMillisToHumanString2(startTimstamp)));
+ return response;
+ }
+
+ response.setCode(-1);
+ super.msgCheck(ctx, requestHeader, response);
--- End diff --
Why not put msgCheck this precondition method into the first row of the
outer method
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---